#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string S; if (!(cin >> S)) return 0; cout << ((S[0] == S[1] && S[2] != S[0]) ? "Yes" : "No") << '\n'; return 0; }