//Normal #define _GLIBCXX_DEBUG #define ll long long #include using namespace std; using Graph = vector>; void print(auto a){ cout << a; } void prints(auto a){ cout << a << " "; } void prints(){ cout << " "; } void printl(auto a){ cout << a << endl; } void printl(){ cout << endl; } void fix(int n){ cout << fixed << setprecision(n); } int main(){ vector> X(5, vector(5, '-')); for(int i = 1; i <= 3; i++){ for(int j = 1; j <= 3; j++){ cin >> X[i][j]; } } vector my = {-1, 0, 0, 1}; vector mx = {0, -1, 1, 0}; for(int i = 1; i <= 3; i++){ for(int j = 1; j <= 3; j++){ for(int k = 0; k < 4; k++){ int MY = i+my[k]; int MX = j+mx[k]; if(X[i][j] == X[MY][MX]){ printl("No"); return 0; } } } } printl("Yes"); return 0; }