a = input() if a == "#.#": b = input() c = input() if b == ".#." and c == a: print("Yes") else: print("No") elif a == ".#.": b = input() c = input() if b == "#.#" and c == a: print("Yes") else: print("No") else: print("No")