G = [list(input()) for _ in range(3)] A = [['#', '.', '#'], ['.', '#', '.'], ['#', '.', '#']] B = [['.', '#', '.'], ['#', '.', '#'], ['.', '#', '.']] if(G==A or G==B): print("Yes") else: print("No")