S1 = input() S2 = input() S3 = input() B = "#.#" W = ".#." if S1 == B == S3 and S2 == W: print('Yes') elif S1 == W == S3 and S2 == B: print('Yes') else: print('No')