s1 = input() s2 = input() s3 = input() if s1 == "#.#": if s2 == ".#." and s1 == s3: print("Yes") else: print("No") elif s1 == ".#.": if s2 == "#.#" and s1 == s3: print("Yes") else: print("No") else: print("No")