#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); ++i) int main() { vector Grid(3, vector(3)); rep(i, 3) rep(j, 3) cin >> Grid[i][j]; char c = Grid[1][1]; bool ok = true; ok &= Grid[0][0] == c; ok &= Grid[0][1] != c; ok &= Grid[0][2] == c; ok &= Grid[1][0] != c; ok &= Grid[1][1] == c; ok &= Grid[1][2] != c; ok &= Grid[2][0] == c; ok &= Grid[2][1] != c; ok &= Grid[2][2] == c; cout << (ok ? "Yes" : "No") << endl; return 0; }