s = input() s += input() s += input() flag = True if s[0] == "#": p = "#" else: p = "." for i in range(len(s)): if i%2 == 0: if s[i] != p: flag = False else: if s[i] != p: flag = False print("Yes" if flag else "No")