s1,s2,s3 = map(str, input().split()) s = [s1,s2,s3] a=[{"gray","brown","green","cyan","blue","yellow","orange","red"}, {"gray","green","blue","yellow","red"}, {"gray","green","cyan","blue","violet","orange","red"}] while len(a) > 0: b = False for si in s: c = 0 for ai in a: if si in ai: c += 1 if c==s.count(si): for ai in a: if si in ai: s.remove(si) a.remove(ai) b = True break if not b: break if len(a) == 0: print("Yes") else: print("No")