from itertools import permutations coders = [ ["gray","brown","green","cyan","blue","yellow","orange","red"], ["gray","green","blue","yellow","red"], ["gray","green","cyan","blue","violet","orange","red"] ] S = input().split() cnt = 0 for perm in set(permutations(S)): if all(s in coders[i] for i, s in enumerate(perm)): cnt += 1 print("Yes" if cnt == 1 else "No")