#include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; getline(cin, s); int n = s.size(); for (int r = 1; r <= n; ++r) { for (int l = 0; l < r; ++l) { if (r - l < 2) { continue; } vector b(n); for (int i = l; i < r; i += 2) { b[i] = true; } string x, y; for (int i = 0; i < n; ++i) { if (b[i]) { x += s[i]; } else { y += s[i]; } } sort(begin(x), end(x)); sort(begin(y), end(y)); if (x.find(' ') != string::npos) { continue; } string z; set_intersection(begin(x), end(x), begin(y), end(y), back_inserter(z)); if (z.empty()) { cout << "Yes\n"; exit(0); } } } cout << "NO\n"; }