/* author: kyawa */ #include using namespace std; /* 考察 */ int main(){ string A; cin >> A; cout << (A[0] == A[1] and A[1] != A[2] ? "Yes" : "No") << '\n'; }