s = input() + input() + input() print("Yes" if s in "#.#.#.#.#." else "No")