def main(): l=[] for i in range(3): tmp=input() l.append(tmp) print(zen(l[0][0],l)) def zen(s,l): for i in range(3): for j in range(3): if (i+j)%2==0 and l[i][j]!=s: return "No" elif (i+j)%2!=0 and l[i][j]==s: return "No" return "Yes" main()