#include using namespace std; using ll = long long; #define rep(i,n) for (int i=0;i<(int)(n);i++) int main(){ string s; cin>>s; if(s.at(0)==s.at(1)&&s.at(0)!=s.at(2)) cout<<"Yes"<