#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
const int maxn = 10000;
int main() {
//freopen("Text.txt", "r", stdin);
string s, t;
while (cin >> s >> t) {
int i=0, j = 0;
while (j < t.size()) {
if (s[i] == t[j]) {
i++;
j++;
}
else
t=t.erase(j,1);//删除从j开始的1个字符
//cout << t << endl;
//cout << j << endl;
}
//cout << s << " " << t << endl;
if (s == t)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
题目链接:
https://vjudge.net/problem/UVA-10340