S = [list(map(int, input().split())) for _ in range(3)] P1 = [ ["#", ".", "#"], [".", "#", "."], ["#", ".", "#"] ] P2 = [ [".", "#", "."], ["#", ".", "#"], [".", "#", "."] ] if S == P1 or S == P2: print("Yes") else: print("No")