s = [] ok = True for i in range(3): s.append(input()) for j in range(3): if i != 0 and s[i - 1][j] == s[i][j]: ok = False # end if j != 0 and s[i][j - 1] == s[i][j]: ok = False # end # end # end if ok: print("Yes") else: print("No") # end