l = [input() for _ in range(3)] s = "".join(l) if s in ("#.#.#.#.#",".#.#.#.#."): print("Yes") else: print("No")