#include using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < n; ++i) int main() { string s1,s2,s3; cin >> s1 >> s2 >> s3; vector onecoder = {"gray","brown","green","cyan","blue","yellow","orange","red"}; vector twocoder = {"gray","green","blue","yellow","red"}; vector threeforces = {"gray","green","cyan","blue","violet","orange","red"}; map cnt; map onetwo; map twothree; map onethree; map dup; dup[s1]++; dup[s2]++; dup[s3]++; for(string s : onecoder){ cnt[s]++; onetwo[s]++; onethree[s]++; } for(string s : twocoder){ cnt[s]++; onetwo[s]++; twothree[s]++; } for(string s : threeforces){ cnt[s]++; onethree[s]++; twothree[s]++; } vector v; v.push_back(s1); v.push_back(s2); v.push_back(s3); sort(v.begin(),v.end()); bool ok = false; do{ if(cnt[s1] == 1 && dup[s1] == 1 && ((twothree[s2] == 1 && dup[s2] == 1) || (twothree[s3] == 1 && dup[s3] == 1)))ok = true; if(cnt[s1] == 1 && dup[s1] == 1 && ((onethree[s2] == 1 && dup[s2] == 1) || (onethree[s3] == 1 && dup[s3] == 1)))ok = true; if(cnt[s1] == 1 && dup[s1] == 1 && ((onetwo[s2] == 1 && dup[s2] == 1) || (onetwo[s3] == 1 && dup[s3] == 1)))ok = true; if(cnt[s1] == 1 && dup[s1] == 1 && twothree[s2] >= 2 && dup[s2] == 2)ok = true; if(cnt[s1] == 1 && dup[s1] == 1 && onethree[s2] >= 2 && dup[s2] == 2)ok = true; if(cnt[s1] == 1 && dup[s1] == 1 && onetwo[s2] >= 2 && dup[s2] == 2)ok = true; if(cnt[s1] == 3 && dup[s1] == 3)ok = true; if(ok)break; }while(next_permutation(v.begin(),v.end())); if(ok){ cout << "Yes" << endl; }else{ cout << "No" << endl; } return 0; }