s = [input() for i in range(3)] mode = 1 for i in range(3): for j in range(2): if s[i][j] == s[i][j+1]: mode = 0 for i in range(2): for j in range(3): if s[i+1][j] == s[i][j]: mode = 0 if mode: print("Yes") else: print("No")