s="#.#.#.#.#" t=".#.#.#.#." u="" for i in range(3): u+=input() if u==s or u==t: print("Yes") else: print("No")