#include using namespace std; int main() { vector S(3); for (int i = 0; i < 3; i++) { cin >> S[i]; } char idx = S[0][0]; bool ok = true; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if ((i + j) % 2 == 0) { if (S[i][j] != idx) { ok = false; } } else { if (S[i][j] == idx) { ok = false; } } } } if (ok) { cout << "Yes" << endl; } else { cout << "No" << endl; } }