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