S = [input() for _ in range(3)] a = "#" b = "." import sys flag = True for i in range(3): for j in range(3): if (i + j) % 2 == 0: if S[i][j] != a: flag = False else: if S[i][j] != b: flag = False if flag: print('Yes') flag = True for i in range(3): for j in range(3): if (i + j) % 2 == 0: if S[i][j] != b: flag = False else: if S[i][j] != a: flag = False if flag: print('Yes') else: print('No')