from collections import Counter a = ['gray','brown','green','cyan','blue','yellow','orange','red'] b = ['gray','green','blue','yellow','red'] c = ['gray','green','cyan','blue','violet','orange','red'] S1, S2, S3 = input().split() def solve(): freq = Counter() for x in a: for y in b: for z in c: t = tuple(sorted([x, y, z])) freq[t] += 1 ss = tuple(sorted([S1, S2, S3])) return freq[ss] == 1 if solve(): print('Yes') else: print('No')