from itertools import* a='gray','brown','green','cyan','blue','yellow','orange','red' b='gray','green','blue','yellow','red' c='gray','green','cyan','blue','violet','orange','red' s1,s2,s3=input().split() f=set() for s in permutations([s1,s2,s3]): if s[0]in a and s[1]in b and s[2]in c: f|={s} if len(f)==1: print('Yes') else: print('No')