#include int main() { int n = 3; int i, j; char s[4][4]; for (i = 0; i < n; i++) scanf("%s", &s[i]); int c = 0; for (i = 0; i < n; i++) for (j = 0; j < n - 1; j++) if (s[i][j] == s[i][j + 1]) c++; for (i = 0; i < n - 1; i++) for (j = 0; j < n; j++) if (s[i][j] == s[i + 1][j]) c++; if (c > 0) printf("No\n"); else printf("Yes\n"); return 0; }