#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> x(4,vector<int>(4));
int main(){
  for(int i=1; i<4; i++){
    for(int j=1; j<4; j++){
      int c;
      cin >> c;
      x[i][j]=c;
    }
  }
  string ans="Yes";
  if(x[1][1]-x[2][1]!=x[1][2]-x[2][2]
   ||x[2][2]-x[3][2]!=x[2][3]-x[3][3]
   ||x[1][1]-x[3][1]!=x[1][3]-x[3][3]) ans="No";
  cout << ans << endl;
}