S1=input() S2=input() S3=input() T=S1+S2+S3 if T=="#.#.#.#.#" or T==".#.#.#.#.": print("Yes") else: print("No")