from collections import defaultdict c1 = ["gray","brown","green","cyan","blue","yellow","orange","red"] c2 = ["gray","green","blue","yellow","red"] c3 = ["gray","green","cyan","blue","violet","orange","red"] d = defaultdict(int) for a in c1: for b in c2: for c in c3: k = [a, b, c] k.sort() d[tuple(k)] += 1 Ss = input().split() Ss.sort() print("Yes" if d[tuple(Ss)] == 1 else "No")