#include <bits/stdc++.h>
using namespace std;

int Max(int &a,int b){return a = max(a,b);}

int dp[2][1001][1001];
int check(const string &a,const string &b){
  int n = a.size();
  int m = b.size();
  assert(n==m);
  int res = 0;
  for(int i=0;i<=n;i++){
    for(int j=0;j<=n;j++){
      Max(res,dp[0][i][j]);
      Max(res,dp[1][i][j]);
      if(j<n) Max(dp[1][i][j+1],dp[1][i][j]);
      if(i<n)Max(dp[0][i+1][j],dp[1][i][j]+1);
      if(i<n&&j<n&&a[i]==b[j])Max(dp[1][i+1][j+1],dp[0][i][j]+1);
    }
  }
  return res>=n;
}

int main(){
  string a,b;
  cin>>a>>b;
  bool ans = check(a,b);
  cout<<(ans? "Yes":"No")<<endl;
  return 0;
}
### Prompt

Please create a solution in cpp to the following problem:

Example

Input

acmicpc
tsukuba


Output

No

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;

int Max(int &a,int b){return a = max(a,b);}

int dp[2][1001][1001];
int check(const string &a,const string &b){
  int n = a.size();
  int m = b.size();
  assert(n==m);
  int res = 0;
  for(int i=0;i<=n;i++){
    for(int j=0;j<=n;j++){
      Max(res,dp[0][i][j]);
      Max(res,dp[1][i][j]);
      if(j<n) Max(dp[1][i][j+1],dp[1][i][j]);
      if(i<n)Max(dp[0][i+1][j],dp[1][i][j]+1);
      if(i<n&&j<n&&a[i]==b[j])Max(dp[1][i+1][j+1],dp[0][i][j]+1);
    }
  }
  return res>=n;
}

int main(){
  string a,b;
  cin>>a>>b;
  bool ans = check(a,b);
  cout<<(ans? "Yes":"No")<<endl;
  return 0;
}
```