#include #include using namespace std; using ll = long long; using mint = atcoder::modint998244353; using maxt = atcoder::modint1000000007; int main() { string S; cin >> S; if(S.at(0) == S.at(1) && S.at(1) != S.at(2)) { cout << "Yes" << endl; } else { cout << "No" << endl; } }