#include <iostream>
#include <string>
using namespace std;

int main() {
    string S, T;
    cin >> S >> T;
    int spos = 0, tpos=0;
    for(int i=0; i<S.size(); ++i) {
        bool update = false;
        for(int j=(i%2 == 0 ? spos : tpos); j<S.size(); ++j) {
            if(i % 2 == 0) {
                if(S[j] == S[i]) {
                    spos = j+1;
                    update = true;
                    break;
                }
            } else {
                if(T[j] == S[i]) {
                    tpos = j+1;
                    update = true;
                    break;
                }
            }
        }
        if(!update) {
            break;
        }
        if(update && i == S.size()-1) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    spos = 0, tpos=0;
    for(int i=0; i<S.size(); ++i) {
        bool update = false;
        for(int j=(i%2 == 0 ? tpos : spos); j<S.size(); ++j) {
            if(i % 2 == 0) {
                if(T[j] == S[i]) {
                    tpos = j+1;
                    update = true;
                    break;
                }
            } else {
                if(S[j] == S[i]) {
                    spos = j+1;
                    update = true;
                    break;
                }
            }
        }
        if(!update) {
            break;
        }
        if(update && i == S.size()-1) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

### Prompt

Your challenge is to write a cpp solution to the following problem:

Example

Input

acmicpc
tsukuba


Output

No

### Response

```cpp
#include <iostream>
#include <string>
using namespace std;

int main() {
    string S, T;
    cin >> S >> T;
    int spos = 0, tpos=0;
    for(int i=0; i<S.size(); ++i) {
        bool update = false;
        for(int j=(i%2 == 0 ? spos : tpos); j<S.size(); ++j) {
            if(i % 2 == 0) {
                if(S[j] == S[i]) {
                    spos = j+1;
                    update = true;
                    break;
                }
            } else {
                if(T[j] == S[i]) {
                    tpos = j+1;
                    update = true;
                    break;
                }
            }
        }
        if(!update) {
            break;
        }
        if(update && i == S.size()-1) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    spos = 0, tpos=0;
    for(int i=0; i<S.size(); ++i) {
        bool update = false;
        for(int j=(i%2 == 0 ? tpos : spos); j<S.size(); ++j) {
            if(i % 2 == 0) {
                if(T[j] == S[i]) {
                    tpos = j+1;
                    update = true;
                    break;
                }
            } else {
                if(S[j] == S[i]) {
                    spos = j+1;
                    update = true;
                    break;
                }
            }
        }
        if(!update) {
            break;
        }
        if(update && i == S.size()-1) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

```