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

int main() {
    int A, B, C, D, E, F, G, H, I; 
    cin >> A >> B >> C >> D >> E >> F >> G >> H >> I; 
  if(D-A == E-B && E-B == F-C && G-A == H-B && H-B == I-C)
    cout << "Yes" << endl;
  else cout << "No" << endl;  
}