#include #include using namespace std; using namespace atcoder; using i64 = long long int; int main() { string s; cin >> s; cout << (s[0] == s[1] && s[0] != s[2] ? "Yes" : "No") << "\n"; return 0; }