stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <vector>

using namespace std;



string S;

int dp[100000];



bool daydream(int now){

    if(now == S.size()){

        return true;

    }else if(dp[now] != -1){

        return dp[now];

    }else{

        int ans = false;

        if(now <= S.size() - 5){

            if(S.substr(now, 5) == "dream"){

                ans |= daydream(now + 5);

            }

            if(S.substr(now, 5) == "erase"){

                ans |= daydream(now + 5);

            }

        }

        if(now <= S.size() - 6){

            if(S.substr(now, 6) == "eraser"){

                ans |= daydream(now + 6);

            }

        }

        if(now <= S.size() - 7){

            if(S.substr(now, 7) == "dreamer"){

                ans |= daydream(now + 7);

            }

        }

        return dp[now] = ans;

    }

}



int main(){

    cin >> S;

    fill(dp, dp + 100000, -1);

    if(daydream(0)){

        cout << "YES" << endl;

    }else{

        cout << "NO" << endl;

    }

}


// Faster C++ solution for the same problem (measured speedup: 1.390419816107361x):
#include <iostream>

#include <algorithm>

#include <vector>

using namespace std;



int main(){

    string S;

    cin >> S;

    reverse(S.begin(), S.end());

    for(int i = 0; i < S.size(); ){

        if(i >= S.size() - 4){

            cout << "NO" << endl;

            return 0;

        }else if(S.substr(i, 5) == "maerd" || S.substr(i, 5) == "esare"){

            i += 5;

        }else if(i == S.size() - 5){

            cout << "NO" << endl;

            return 0;

        }else if(S.substr(i, 6) == "resare"){

            i += 6;

        }else if(i == S.size() - 6){

            cout << "NO" << endl;

            return 0;

        }else if(S.substr(i, 7) == "remaerd"){

            i += 7;

        }else{

            cout << "NO" << endl;

            return 0;

        }

    }

    cout << "YES" << endl;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s;

int dp[100005];

int main()

{

	cin>>s;

    dp[0]=1;

	for(int i=0;i<s.size();i++)

	{

		if(dp[i]==0)continue;

		if(i+5<=s.size()&&s.substr(i,5)=="dream") dp[i+5]=1;

		if(i+5<=s.size()&&s.substr(i,5)=="erase") dp[i+5]=1;

		if(i+6<=s.size()&&s.substr(i,6)=="eraser") dp[i+6]=1;

		if(i+7<=s.size()&&s.substr(i,7)=="dreamer") dp[i+7]=1;

		}	

	if(dp[s.size()]==1) cout<<"YES"<<endl;

	else 

	    cout<<"NO"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.381682204943413x):
#include <cstdio>

#include <cstring>

char s[100050];

int fail;

int maxlen;

const char str[4][10]={"eraser ","erase ","dreamer ","dream "};

const int len[4]={6,5,7,5};

bool dfs(int pos)

{

	if(pos==maxlen) return 1;

	for(int i=3;i>=0;i--)

	{

		bool flag=1;

		for(int j=0;str[i][j]!=' ';j++)

			if(pos+j>=maxlen || str[i][j]!=s[pos+j])

			{flag=0;break;}

		if(flag)

		{

			if(dfs(pos+len[i])) return 1;

		}

	}

	return 0;

}

int main()

{

	scanf("%s",s);

	maxlen=strlen(s);

	bool ans=dfs(0);

	if(ans) puts("YES");

	else puts("NO");

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

    string str[4]={"maerd","remaerd","resare","esare"};

	string s;

	cin>>s;

	reverse(s.begin(),s.end());

	bool a=true;

	for(int i=0;i<s.size();)

	{

		bool b=false;

		for(int j=0;j<4;j++)

		{   

		    string d=str[j];

			if(s.substr(i,d.size())==d){

				b=true;i+=d.size();

			}

		}

		if(!b){

			a=false;break;

		}

	}

	if(a)cout<<"YES"<<endl;

	else cout<<"NO"<<endl;

} 

// Faster C++ solution for the same problem (measured speedup: 5.375340030019927x):
#include <cstdio>

#include <cstring>

char s[100050];

int fail;

int maxlen;

const char str[4][10]={"eraser ","erase ","dreamer ","dream "};

const int len[4]={6,5,7,5};

bool dfs(int pos)

{

	if(pos==maxlen) return 1;

	for(int i=3;i>=0;i--)

	{

		bool flag=1;

		for(int j=0;str[i][j]!=' ';j++)

			if(pos+j>=maxlen || str[i][j]!=s[pos+j])

			{flag=0;break;}

		if(flag)

		{

			if(dfs(pos+len[i])) return 1;

		}

	}

	return 0;

}

int main()

{

	scanf("%s",s);

	maxlen=strlen(s);

	bool ans=dfs(0);

	if(ans) puts("YES");

	else puts("NO");

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <algorithm>

#define REP(i, n) for (int i = 0; i < n; ++i)

#define ALL(v) (v).begin(), (v).end()

#define REVERSED(v) reverse( ALL(v) )

#define YESNO(x) cout << ( x ? "YES" : "NO" ) << endl

using namespace std;



string divide[4] = {"dream", "dreamer", "erase", "eraser"};



int main() {

    string S;

    cin >> S;



    REVERSED(S);

    REP(i,4) REVERSED(divide[i]);



    bool can = true;

    for (int i = 0; i < S.size(); ) {

        can = false;

        REP(j,4) {

            string d = divide[j];

            if ( S.substr(i, d.size()) == d ) {

                can = true;

                i += d.size();

            }

        }

        if (!can) {

            break;

        }

    }



    YESNO(can);

}

// Faster C++ solution for the same problem (measured speedup: 5.3846308737389x):
#include <cstdio>

#include <cstring>



char s[100005]; int n;

bool dp[100005];



int main() {

  scanf("%s", s + 1); n = strlen(s + 1);



  dp[0] = 1;

  for (int i = 1; i <= n; ++i) {

    if (i>=5 && s[i-4]=='d' && s[i-3]=='r' && s[i-2]=='e' && s[i-1]=='a' && s[i]=='m')

      dp[i] |= dp[i-5];

    if (i>=7 && s[i-6]=='d' && s[i-5]=='r' && s[i-4]=='e' && s[i-3]=='a' && s[i-2]=='m' && s[i-1]=='e' && s[i]=='r')

      dp[i] |= dp[i-7];

    if (i>=5 && s[i-4]=='e' && s[i-3]=='r' && s[i-2]=='a' && s[i-1]=='s' && s[i]=='e')

      dp[i] |= dp[i-5];

    if (i>=6 && s[i-5]=='e' && s[i-4]=='r' && s[i-3]=='a' && s[i-2]=='s' && s[i-1]=='e' && s[i]=='r')

      dp[i] |= dp[i-6];

  }



  puts(dp[n] ? "YES" : "NO");



  return 0;

}
// Slower C++ solution:
#include <iostream>

#include <sstream>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <ctime>

#include <cstring>

#include <string>

#include <vector>

#include <stack>

#include <queue>

#include <deque>

#include <map>

#include <set>

#include <bitset>

#include <numeric>

#include <utility>

#include <iomanip>

#include <algorithm>

#include <functional>

using namespace std;



#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)



template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)

{ return s << '<' << P.first << ", " << P.second << '>'; }

template<class T> ostream& operator << (ostream &s, vector<T> P)

{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }

template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)

{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }

template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)

{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }





string str;

bool dp[210000];

string judge [4] = {"dream", "dreamer", "erase", "eraser"};



int main() {

  while (cin >> str) {

	memset(dp, 0, sizeof(dp));

	dp[0] = true;

	for (int i = 0; i < str.size(); ++i) {

	  if (!dp[i]) continue;

	  for (int j = 0; j < 4; ++j) {

		if (str.substr(i, judge[j].size()) == judge[j])

		  dp[i + judge[j].size()] = true;

	  }

	}

	if (dp[str.size()]) puts("YES");

	else puts("NO");

  }

}

		  

	  


// Faster C++ solution for the same problem (measured speedup: 1.2050900802184248x):
#include <iostream>

#include <string>

#include <algorithm>

using namespace std;



string divide[4] = {"dream", "dreamer", "erase", "eraser"};



int main() {

    string S;

    cin >> S;

 

    // 後ろから解くかわりにすべての文字列を「左右反転」する

    reverse(S.begin(), S.end());

    for (int i = 0; i < 4; ++i) reverse(divide[i].begin(), divide[i].end());

    

    // 端から切っていく

    bool can = true;

    for (int i = 0; i < S.size();) {

        bool can2 = false; // 4 個の文字列たちどれかで divide できるか

        for (int j = 0; j < 4; ++j) {

            string d = divide[j];

            if (S.substr(i, d.size()) == d) { // d で divide できるか

                can2 = true;

                i += d.size(); // divide できたら i を進める

            }

        }

        if (!can2) { // divide できなかったら

            can = false;

            break;

        }

    }

    

    if (can) cout << "YES" << endl;

    else cout << "NO" << endl;

}
// Slower C++ solution:
#include <iostream>

#include <string>



using namespace std;



int main() {

    int dp[100005] = {1};



    string S;

    cin >> S;



	for (int i = 0; i < S.size(); i++) {

		if (dp[i] == 0) { continue; }

		if (i + 5 <= S.size() && S.substr(i, 5) == "dream") { dp[i + 5] = 1; }

		if (i + 7 <= S.size() && S.substr(i, 7) == "dreamer") { dp[i + 7] = 1; }

		if (i + 5 <= S.size() && S.substr(i, 5) == "erase") { dp[i + 5] = 1; }

		if (i + 6 <= S.size() && S.substr(i, 6) == "eraser") { dp[i + 6] = 1; }

	}



	if (dp[S.size()] == 1) { cout << "YES" << endl; }

	else { cout << "NO" << endl; }



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.3934626998017652x):
#include <iostream>

#include <string>



using namespace std;



// dp[i] := i文字目までを作ることができるか?

bool dp[100010];

string divide[4] = {"dream", "dreamer", "erase", "eraser"};



int main() {

  string s; cin >> s;



  dp[0] = true;

  for (int i = 0; i < s.length(); i++) {

    if (!dp[i]) { continue; }

    for (int j = 0; j < 4; j++) {

      string t = divide[j];

      if (s.substr(i, t.size()) == t) {

        dp[i+t.size()] = true;

      }

    }

  }

  cout << (dp[s.length()] ? "YES" : "NO") << endl;

  return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define _GLIBCXX_DEBUG

#define rep(i,n) for(int i = 0; i < (n); ++i)

#define ll long long

#define P pair<ll,ll>

#define all(v) (v).begin(),(v).end()



const ll mod = 1e9+7;

const ll INF = 1e18;

const double pi = acos(-1);





int main(void)

{

    ll r,g,b,n,cnt=0; cin>>r>>g>>b>>n;

    rep(i,n+1)rep(j,n+1){

        ll x=r*i+g*j;

        if((n-x)%b==0 && x<=n) cnt++;

    }

    cout<<cnt<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.2805374426675626x):
#include <bits/stdc++.h>

using namespace std;

#define _GLIBCXX_DEBUG

#define rep(i,n) for(int i = 0; i < (n); ++i)

#define ll long long

#define P pair<ll,ll>

#define all(v) (v).begin(),(v).end()



const ll mod = 1e9+7;

const ll INF = 1e18;

const double pi = acos(-1);





int main(void)

{

    ll r,g,b,n,cnt=0; cin>>r>>g>>b>>n;

    rep(i,n+1)rep(j,n+1){

        ll x=r*i+g*j;

        if(n-x>=0 && (n-x)%b==0) cnt++;

    }

    cout<<cnt<<endl;

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int main() {

  int r,g,b,n,ans=0;

  cin>>r>>g>>b>>n;

  for (int i=0;i<=n;i++){

    for(int j=0;j<=n;j++){

      if((n-(i*r)-(j*g))/b>=0 && i*r+j*g+b*((n-(i*r)-(j*g))/b)==n){

          ans++;}

      }

    }

  cout<<ans;

  return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.2639554008341778x):
#include <iostream>

#include <algorithm>

using namespace std;

#define lli long long int



int main() {

  int R, G, B, N;

  cin >> R >> G >> B >> N;

  lli cont=0;

  for(int i=0; i<=N; i++){

    for(int j=0; j<=N; j++){

      int A = N - i*R - j*G;

      if(A>=0){

        if(A % B == 0 && A/B <= N)

          cont++;

      }

    }

  }

  cout << cont;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main(){

    long long R,G,B,N;

    cin >> R >> G >> B >> N;

    long long ans = 0;

    for(int i = 0; i <= N; i++){

        for(int j = 0; j <= N; j++){

        int X = N-R*i-G*j;       

            if(X%B == 0 && X>=0){

            ans++;

            }     

        }

    }

    cout << ans << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.2742736822834195x):
#include <bits/stdc++.h>

using namespace std;

#define int long long

typedef pair<int,int> P;

int INF = 1e18;

int mod = 1e9+7;

int dx[4] = {1, 0, -1, 0};

int dy[4] = {0, 1, 0, -1};

signed main() {

    int R,G,B,N;

    cin >> R >> G >> B >> N;

    int ans = 0;

    for(int i = 0; i*R <= N; i++) {

        for(int j = 0; i*R+j*G <= N; j++) {

            if((N-i*R-j*G)%B == 0) {

                ans++;

            }

        }

    }

    cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;





int main() {



    int R, G, B, N;

    cin >> R >> G >> B >> N;

    long long ans = 0;

    int MAX = N + 1;

    for (int i = 0; i < MAX; ++i) {

        for (int j = 0; j < MAX; ++j) {

            long long balls = i * R + j * G;

            if ((N - balls) % B == 0 && (N - balls) / B >= 0) {

                ans++;

            }

        }

    }

    cout << ans << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.2769253650216221x):
#include <bits/stdc++.h>



using namespace std;





int main() {



    int R, G, B, N;

    cin >> R >> G >> B >> N;

    long long ans = 0;

    int MAX = N + 1;

    for (int i = 0; i < MAX; ++i) {

        int r = i * R;

        if (r > N){ break;}

        for (int j = 0; j < MAX; ++j) {

            long long balls = i * R + j * G;

            if ((N - balls) % B == 0 && (N - balls) / B >= 0) {

                ans++;

            }

        }

    }

    cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;





int main() {



    int R, G, B, N;

    cin >> R >> G >> B >> N;

    long long ans = 0;

    int MAX = N + 1;

    for (int i = 0; i < MAX; ++i) {

        for (int j = 0; j < MAX; ++j) {

            long long balls = i * R + j * G;

            if ((N - balls) % B == 0 && (N - balls) / B >= 0) {

                ans++;

            }

        }

    }

    cout << ans << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.3206493715442396x):
#include <bits/stdc++.h>



using namespace std;





int main() {



    int R, G, B, N;

    cin >> R >> G >> B >> N;

    long long ans = 0;

    int MAX = N + 1;

    for (int i = 0; i < MAX; ++i) {

        int r = i * R;

        if (r > N){ break;}

        for (int j = 0; j < MAX; ++j) {

            if (i * R + j * G > N ){break;}

            long long balls = i * R + j * G;

            if ((N - balls) % B == 0 && (N - balls) / B >= 0) {

                ans++;

            }

        }

    }

    cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;





int main() {



    int R, G, B, N;

    cin >> R >> G >> B >> N;

    long long ans = 0;

    int MAX = N + 1;

    for (int i = 0; i < MAX; ++i) {

        for (int j = 0; j < MAX; ++j) {

            long long balls = i * R + j * G;

            if ((N - balls) % B == 0 && (N - balls) / B >= 0) {

                ans++;

            }

        }

    }

    cout << ans << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.3206976728159814x):
#include <bits/stdc++.h>



using namespace std;





int main() {



    int R, G, B, N;

    cin >> R >> G >> B >> N;

    long long ans = 0;

    int MAX = N + 1;

    for (int i = 0; i <= N / R; ++i) {

        int r = i * R;

        if (r > N){ break;}

        for (int j = 0; j <= N/ G; ++j) {

            if (i * R + j * G > N ){break;}

            long long balls = i * R + j * G;

            if ((N - balls) % B == 0 && (N - balls) / B >= 0) {

                ans++;

            }

        }

    }

    cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;





int main() {



    int R, G, B, N;

    cin >> R >> G >> B >> N;

    long long ans = 0;

    int MAX = N + 1;

    for (int i = 0; i < MAX; ++i) {

        for (int j = 0; j < MAX; ++j) {

            long long balls = i * R + j * G;

            if ((N - balls) % B == 0 && (N - balls) / B >= 0) {

                ans++;

            }

        }

    }

    cout << ans << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.3081195567059327x):


#include <bits/stdc++.h>



using namespace std;



int main() {



    int R, G, B, N;

    cin >> R >> G >> B >> N;

    int  ans = 0;

    int MAX = N + 1;

    for (int i = 0; i <= N / R; ++i) {

        //int r = i * R;

        //if (r > N){ break;}

        for (int j = 0; j <= N/ G; ++j) {

          //  if (i * R + j * G > N ){break;}

            int balls = i * R + j * G;

            if ((N - balls) % B == 0 && (N - balls) / B >= 0) {

                ans++;

            }

        }

    }

    cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

 

int main() {

  int R,G,B,N;

  cin >>R>>G>>B>>N;

  int ans=0;

  

 for(int i=0;i<=N;i++){

 for(int j=0;j<=N;j++){

   int a=N-(i*R+j*G);

   

   if(a%B==0){if(a>=0){ans++;}} 

 }

 }

  

  cout <<ans<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.3410124254943967x):
#include <bits/stdc++.h>

using namespace std;

 

int main() {

  int R,G,B,N;

  cin >>R>>G>>B>>N;

  int ans=0;

  

 for(int i=0;i<=N;i+=R){

 for(int j=0;i+j<=N;j+=G){

   int a=N-(i+j);

   

   if(a%B==0){if(a>=0){ans++;}} 

 }

 }

  

  cout <<ans<<endl;

}
// Slower C++ solution:
#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>

#define rep(i,n) for (int i = 0;i < (n);i++)

#define all(v) v.begin(),v.end()

using namespace std;

using ll = long long;

using P = pair<ll,ll>;

using vl = vector<ll>;

using vvl = vector<vl>;



ll gcd(ll a,ll b){

  if(b == 0) return a;

  return gcd(b , a % b);

}



ll mod(ll a){

  return a % 1000000007;

}



ll lcm(ll a,ll b){

  return (a*b)/gcd(a,b);

}





int main(){

  ll r,g,b,n; cin >> r >> g >> b >> n; ll count = 0;

  

  for(ll i=0; i <= n; i++){

    for(ll j=0; j <= n; j++){

      if((n-r*i-g*j) % b == 0 && n-r*i-g*j >= 0) count++;

    }

  }

  

  cout << count << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.27479454188832x):
#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>

#include<algorithm>//next_permutation

#define rep(i,n) for (int i = 0;i < (n);i++)

#define all(v) v.begin(),v.end()

#define dec(n) cout << fixed << setprecision(n);

#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

#define small "abcdefghijklmnopqrstuvwxyz"

using namespace std;

using ll = long long;

using P = pair<ll,ll>;

using vl = vector<ll>;

using vvl = vector<vl>;



ll gcd(ll a,ll b){

  if(b == 0) return a;

  return gcd(b , a % b);

}



const ll MOD = 1000000007;

const ll MAX = 2000001;



ll mod(ll a){

  return a % MOD;

}



ll lcm(ll a,ll b){

  return (a*b)/gcd(a,b);

}



ll fac[MAX], finv[MAX], inv[MAX];



void nCrprep() {

    fac[0] = fac[1] = 1;

    finv[0] = finv[1] = 1;

    inv[1] = 1;

    for (ll i = 2; i < MAX; i++){

        fac[i] = fac[i - 1] * i % MOD;

        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;

        finv[i] = finv[i - 1] * inv[i] % MOD;

    }

}



ll nCr(ll n, ll r){

    if (n < r) return 0;

    if (n < 0 || r < 0) return 0;

    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;

}



ll nCrcheep(ll n,ll r){

  if(r == 0) return 1;

  else if(r == 1) return n;

  else return nCrcheep(n-1,r-1)*n/r;

}



vector<pair<ll,ll>> prime_factorize(ll n){

  vector<pair<ll,ll>> res;

  

  for(ll i=2; i*i <= n; i++){

    if(n % i != 0) continue;

    

    ll ex = 0;

    while(n % i == 0){

      ex++;

      n /= i;

    }

    

    res.push_back({i,ex});

  }

  

  if(n != 1) res.push_back({n,1});

  

  return res;

  

}









int main(){

  ll r,g,b,n; cin >> r >> g >> b >> n;

  ll ans = 0;

  

  rep(i,n+1){

    rep(j,n+1){

      if(n-r*i-g*j >= 0 and (n-r*i-g*j) % b == 0) ans++;

    }

  }

  

  cout << ans << endl;

  

  

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

 string x;

    cin>>x;

    int a=0,b=0;

    for(int i=0;i<3;i++){

        if(x.at(i)=='A'){

            a++;

        }

        else{

            b++;

        }

    }

    if(a==0|| b==0){

        cout<<"No";

    }

    else{

        cout<<"Yes";

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.346910641468817x):
#include<stdio.h>

int main(){

	char a,b,c;

	scanf("%c%c%c",&a,&b,&c);

	if(a==b && a!=c && b!=c){

		printf("Yes");

	}

	if(a==c && a!=b && b!=c){

		printf("Yes");

	}

	if(b==c && a!=b && a!=c){

		printf("Yes");

	}

	else if(a==b && a==c && b==c){

		printf("No");

	}

		return 0;	

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main() {

    string a;

    cin>>a;

    set <char> s;

    for (int i=0;i<a.length();i++)

        s.insert(a[i]);

    if (s.size()==2)

        cout<<"Yes"<<endl;



    else cout<<"No"<<endl;

    

    

    

}

// Faster C++ solution for the same problem (measured speedup: 5.416417491969644x):
#include<stdio.h>

int main(){

	char a,b,c;

	scanf("%c%c%c",&a,&b,&c);

	if(a==b && a!=c && b!=c){

		printf("Yes");

	}

	if(a==c && a!=b && b!=c){

		printf("Yes");

	}

	if(b==c && a!=b && a!=c){

		printf("Yes");

	}

	else if(a==b && a==c && b==c){

		printf("No");

	}

		return 0;	

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

 string x;

    cin>>x;

    int a=0,b=0;

    for(int i=0;i<3;i++){

        if(x.at(i)=='A'){

            a++;

        }

        else{

            b++;

        }

    }

    if(a==0|| b==0){

        cout<<"No";

    }

    else{

        cout<<"Yes";

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.335843771689196x):
#include<stdio.h>

int main()

{

	char A;

	char B;

	char C;

	scanf("%c %c %c",&A,&B,&C);

	if(A==B&&B==C&&C==A)

	printf("No");

	else if(A==B || B==C || C==A)

	printf("Yes");

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main() {

    string a;

    cin>>a;

    set <char> s;

    for (int i=0;i<a.length();i++)

        s.insert(a[i]);

    if (s.size()==2)

        cout<<"Yes"<<endl;



    else cout<<"No"<<endl;

    

    

    

}

// Faster C++ solution for the same problem (measured speedup: 5.405206759067023x):
#include<stdio.h>

int main()

{

	char A;

	char B;

	char C;

	scanf("%c %c %c",&A,&B,&C);

	if(A==B&&B==C&&C==A)

	printf("No");

	else if(A==B || B==C || C==A)

	printf("Yes");

	return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

 string x;

    cin>>x;

    int a=0,b=0;

    for(int i=0;i<3;i++){

        if(x.at(i)=='A'){

            a++;

        }

        else{

            b++;

        }

    }

    if(a==0|| b==0){

        cout<<"No";

    }

    else{

        cout<<"Yes";

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.316173290007589x):
#include <stdio.h>



int main(){

	char S, A, B;

	scanf("%s=c", &S, &A, &B);

	if(S, A != B){

		printf("Yes\n");

	}else if(S, B != A){

		printf("Yes\n");

	}else if(A, B != S){

		printf("Yes\n");

	}else if( S == A, A == B){

		printf("No\n");

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main() {

    string a;

    cin>>a;

    set <char> s;

    for (int i=0;i<a.length();i++)

        s.insert(a[i]);

    if (s.size()==2)

        cout<<"Yes"<<endl;



    else cout<<"No"<<endl;

    

    

    

}

// Faster C++ solution for the same problem (measured speedup: 5.385280572115363x):
#include <stdio.h>



int main(){

	char S, A, B;

	scanf("%s=c", &S, &A, &B);

	if(S, A != B){

		printf("Yes\n");

	}else if(S, B != A){

		printf("Yes\n");

	}else if(A, B != S){

		printf("Yes\n");

	}else if( S == A, A == B){

		printf("No\n");

	}

	return 0;

}