import sys input = sys.stdin.readline from itertools import permutations A=[["gray","brown","green","cyan","blue","yellow","orange","red"],["gray","green","blue","yellow","red"],["gray","green","cyan","blue","violet","orange","red"]] S=list(input().split()) L=list(permutations(S)) ANS=set() for x,y,z in L: if x in A[0] and y in A[1] and z in A[2]: ANS.add((x,y,z)) if len(ANS)==1: print("Yes") else: print("No")