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