#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() template using V=vector; template using VV=V>; using u128=__int128_t; using ll=long long; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); VV A={ {"gray","brown","green","cyan","blue","yellow","orange","red"}, {"gray","green","blue","yellow","red"}, {"gray","green","cyan","blue","violet","orange","red"} }; V B(3); rep(i,3) cin>>B[i]; V C(3); rep(i,3) C[i]=i; int cnt=0; set> st; do{ array tmp; int c=0; rep(i,3){ for(auto x:A[C[i]]){ if(x==B[i]){ tmp[C[i]]=x; c++; } } } if(c==3) st.insert(tmp); }while(next_permutation(ALL(C))); if(st.size()==1) cout<<"Yes"<