a,b,c = [input() for _ in range(3)] if a in ("#.#",".#.") and a.replace() == b and a == c: print("Yes") else: print("No")