#include using namespace std; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=20000000000000; ll mod=998244353; int main(){ string s; cin >> s; if (s[0]==s[1]&&s[1]!=s[2]) { cout << "Yes" << endl; }else{ cout << "No" << endl; } }