#include #include using namespace std; int main(){ vector> A(3,vector(3)); for(int i = 0; 3 > i; i++){ for(int j = 0; 3 > j; j++){ cin>>A[i][j]; } } for(int i = 0; 3 > i; i++){ for(int j = 0; 3 > j; j++){ if(A[i][j] != (((i+j)%2 ? A[0][1] : A[0][0]))){ cout << "No" << endl; return 0; } } } if(A[0][1] == A[0][0])cout << "No" << endl; else cout << "Yes" << endl; }