#include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
string s1, s2;
cin >> s1 >> s2;
if (s2.length() == s1.length() + 1) {
bool flag = false;
int i = 0, j = 0;
while (i < s1.length() && j < s2.length()) {
if (s1[i] != s2[j]) {
if (flag) {
cout << "No\n";
return 0;
}
flag = true;
j++;
} else {
i++;
j++;
}
}
cout << "Yes\n";
} else {
cout << "No\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpIHsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oMCk7ICBjaW4udGllKDApOyBjb3V0LnRpZSgwKTsKICAgIAogICAgc3RyaW5nIHMxLCBzMjsKICAgIGNpbiA+PiBzMSA+PiBzMjsKICAgIGlmIChzMi5sZW5ndGgoKSA9PSBzMS5sZW5ndGgoKSArIDEpIHsKICAgICAgICBib29sIGZsYWcgPSBmYWxzZTsKICAgICAgICBpbnQgaSA9IDAsIGogPSAwOwoKICAgICAgICB3aGlsZSAoaSA8IHMxLmxlbmd0aCgpICYmIGogPCBzMi5sZW5ndGgoKSkgewogICAgICAgICAgICBpZiAoczFbaV0gIT0gczJbal0pIHsKICAgICAgICAgICAgICAgIGlmIChmbGFnKSB7CiAgICAgICAgICAgICAgICAgICAgY291dCA8PCAiTm9cbiI7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBmbGFnID0gdHJ1ZTsKICAgICAgICAgICAgICAgIGorKzsgCiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBpKys7CiAgICAgICAgICAgICAgICBqKys7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgY291dCA8PCAiWWVzXG4iOwogICAgfSBlbHNlIHsKICAgICAgICBjb3V0IDw8ICJOb1xuIjsKICAgIH0KCiAgICByZXR1cm4gMDsKfQo=