from itertools import permutations A = ["gray","brown","green","cyan","blue","yellow","orange","red"] B = ["gray","green","blue","yellow","red"] C = ["gray","green","cyan","blue","violet","orange","red"] D = list(input().split()) E = set() for p in permutations(D,3): if p[0] in A and p[1] in B and p[2] in C: E.add((p[0],p[1],p[2])) if len(E)==1: print("Yes") else: print("No")