Colors=[] Colors.append(set(["gray","brown","green","cyan","blue","yellow","orange","red"])) Colors.append(set(["gray","green","blue","yellow","red"])) Colors.append(set(["gray","green","cyan","blue","violet","orange","red"])) S=list(input().split()) cands=[[0,0,0] for _ in range(3)] for i,s in enumerate(S): for j,colors in enumerate(Colors): if s in colors:cands[i][j]+=1 for i in range(3): if sum(cands[i])==1: for ii in range(3): if ii==i:continue cands[ii][cands[i].index(1)]=0 for j in range(3): sm=0 ii=-1 for i in range(3): sm+=cands[i][j] if cands[i][j]==1:ii=i if sm==1: for jj in range(3): if jj==j:continue cands[ii][jj]=0 if sum(cands[0])==1 and sum(cands[1])==1 and sum(cands[2])==1:exit(print("Yes")) if sum(cands[0])==1 and sum(cands[1])==2 and sum(cands[2])==2 and S[1]==S[2]:exit(print("Yes")) if sum(cands[0])==2 and sum(cands[1])==1 and sum(cands[2])==2 and S[0]==S[2]:exit(print("Yes")) if sum(cands[0])==2 and sum(cands[1])==2 and sum(cands[2])==1 and S[0]==S[1]:exit(print("Yes")) if sum(cands[0])==3 and sum(cands[1])==3 and sum(cands[2])==3 and S[0]==S[1]==S[2]:exit(print("Yes")) print("No")