from itertools import permutations S = list(input().split()) A = [["gray","brown","green","cyan","blue","yellow","orange","red"], ["gray","green","blue","yellow","red"], ["gray","green","cyan","blue","violet","orange","red"]] cnt = 0 for perm in permutations(range(3)): for i in range(3): if S[i] not in A[perm[i]]: break else: cnt += 1 if S.count(S[0]) == 3: print("Yes" if cnt == 6 else "No") elif S.count(S[0]) == 2 or S.count(S[1]) == 2: print("Yes" if cnt == 2 else "No") else: print("Yes" if cnt == 1 else "No")