G = [] for _ in range(3): s = list(input()) G += s for i in range(8): if G[i] == G[i+1]: print('No') break else: print('Yes')