s=[input() for i in range(3)] flag=True for i in range(3): for j in range(3): if i<2: if s[i+1][j]==s[i][j]: flag=False break if j<2: if s[i][j+1]==s[i][j]: flag=False break if flag: print("Yes") else: print("No")