s = "".join([input() for _ in range(3)]) a = "Yes" for i in range(8): if s[i] == s[i+1]: a = "No" break print(a)