#icpc2015autumna. [icpc2015autumn_a]M and A
[icpc2015autumn_a]M and A
MathJax.Hub.Config({ tex2jax: { inlineMath: [[""], ["\\(","\\)"]], processEscapes: true }}); blockquote { font-family: Menlo, Monaco, "Courier New", monospace; color: #333333; display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }
Problem Statement
The CEO of the company named is planning M&A with another company named . M&A is an abbreviation for "Mergers and Acquisitions". The CEO wants to keep the original company name through the M&A on the plea that both company names are mixed into a new one.
The CEO insists that the mixed company name after the M&A is produced as follows.
Let be an arbitrary subsequence of , and be an arbitrary subsequence of . The new company name must be a string of the same length to obtained by alternatively lining up the characters in and . More formally, or can be used as the company name after M&A. Here, denotes the -th (0-based) character of string . Please note that the lengths of and will be different if the length of is odd. In this case, the company name after M&A is obtained by or ( denotes the length of and "/" denotes integer division).
A subsequence of a string is a string which is obtained by erasing zero or more characters from the original string. For example, the strings "abe", "abcde" and "" (the empty string) are all subsequences of the string "abcde".
You are a programmer employed by the acquiring company. You are assigned a task to write a program that determines whether it is possible to make , which is the original company name, by mixing the two company names.
Input
The input consists of a single test case. The test case consists of two lines.
The first line contains a string which denotes the name of the company that you belong to. The second line contains a string which denotes the name of the target company of the planned M&A. The two names and are non-empty and of the same length no longer than characters, and all the characters used in the names are lowercase English letters.
Output
Print "Yes" in a line if it is possible to make original company name by combining and . Otherwise, print "No" in a line.
Sample Input 1
acmicpc
tsukuba```
### Output for the Sample Input 1
```plain
No```
* * *
### Sample Input 2
```plain
hoge
moen```
### Output for the Sample Input 2
```plain
Yes```
* * *
### Sample Input 3
```plain
abcdefg
xacxegx```
### Output for the Sample Input 3
```plain
Yes```
* * *