#include <bits/stdc++.h>
using namespace std;
int main() {
string str, str2 = "", str3 = "";
char a;
cin >> str >> a;
for (int i = 0; i < str.size(); i++) {
if (str[i] != a) {
str2 += str[i];
}
}
for (int i = str2.size() - 1; i >= 0; i--) {
str3 += str2[i];
}
if (str3 == str2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}