w="#.#" b=".#." t=False s1=input() s2=input() s3=input() if s1==w: if s2==b and s3==w: t=True elif s1==b: if s2==w and s3==b: t=True print("Yes" if t else "No")