// Original C++ solution (slower):
#include <iostream>

#include <string>

#include <cstring>

#include <cstdio>

#include <algorithm>

#include <vector>

#include <set>

#include <map>

#include <queue>

#include <stack>

#include <numeric>

#include <regex>



#define FOR(i, f, n) for(int (i) = (f); (i) < (n); (i)++)

#define RFOR(i, f, n) for(int (i) = (f); (i) >= (n); (i)--)

#define REP(i, n) for(int (i) = 0; (i) < (n); (i)++)

#define RREP(i, n) for(int (i) = (n); (i) >= 0; (i)--)

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)

#define rrep(i, n) for(int (i) = (n); (i) >= 0; (i)--)

#define forin(i, a) for(auto i: (a))

#define p(...) printf(__VA_ARGS__); cout << endl;

#define in(...) __VA_ARGS__; input__(__VA_ARGS__);

#define input(...) in(__VA_ARGS__)

#define out(...) output__(__VA_ARGS__);

#define output(...) out(__VA_ARGS__)

#define list_input(x, n) x[(n)]; for(int (i) = 0; (i) < (n); (i)++) cin >> x[i];

#define lambda(a, b, c) [](auto const &a, auto const &b){ return c ;}

#define key(t, x, compare) [](const t &a, const t &b){ return a x compare b x ;}

#define unless(a) if(!(a))



using namespace std;



using pii = pair<int, int>;



template <class... T>

void input__(T &...a) {

  for(auto v: {&a...}) {

    cin >> *v;

  }

}



void output__(){

  cout << endl;

}



template <class Head, class... T>

void output__(Head const &v, T const &...a) {

  if(sizeof...(a) == 0) {

    cout << v;

  } else {

    cout << v << " ";

  }

  output__(a...);

}



bool all_ok(int a1, int a2, int a3, int b1, int b2, int b3, int c[3][3]) {

  int a[3] = {a1, a2, a3};

  int b[3] = {b1, b2, b3};



  rep(i, 3) rep(j, 3) {

    if(c[i][j] != a[i] + b[j]) {

      return false;

    }

  }

  return true;

}



int main(){

  int c[3][3];

  rep(i, 3) rep(j, 3) {

    cin >> c[i][j];

  }



  FOR(a1, -200, 201) {

    int b1 = c[0][0] - a1;

    FOR(a2, -200, 201) {

      int b2 = c[0][1] - a1;

      FOR(a3, -200, 201) {

        int b3 = c[0][2] - a1;



        if(all_ok(a1, a2, a3, b1, b2, b3, c)) {

          out("Yes");

          exit(0);

        }

      }

    }

  }

  out("No");

}


// Optimized solution to the same problem (faster):
#include <iostream>

#include <string>

#include <cstring>

#include <cstdio>

#include <algorithm>

#include <vector>

#include <set>

#include <map>

#include <queue>

#include <stack>

#include <numeric>

#include <regex>

#include <climits>



#define FOR(i, f, n) for(int (i) = (f); (i) < (n); (i)++)

#define RFOR(i, f, n) for(int (i) = (f); (i) >= (n); (i)--)

#define REP(i, n) for(int (i) = 0; (i) < (n); (i)++)

#define RREP(i, n) for(int (i) = (n); (i) >= 0; (i)--)

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)

#define rrep(i, n) for(int (i) = (n); (i) >= 0; (i)--)

#define forin(i, a) for(auto i: (a))

#define p(...) printf(__VA_ARGS__); cout << endl;

#define in(...) __VA_ARGS__; input__(__VA_ARGS__);

#define input(...) in(__VA_ARGS__)

#define out(...) output__(__VA_ARGS__);

#define output(...) out(__VA_ARGS__)

#define list_input(x, n) x[(n)]; for(int (i) = 0; (i) < (n); (i)++) cin >> x[i];

#define lambda(a, b, c) [](auto const &a, auto const &b){ return c ;}

#define key(t, x, compare) [](const t &a, const t &b){ return a x compare b x ;}

#define unless(a) if(!(a))



using namespace std;



using pii = pair<int, int>;



template <class... T>

void input__(T &...a) {

  for(auto v: {&a...}) {

    cin >> *v;

  }

}



void output__(){

  cout << endl;

}



template <class Head, class... T>

void output__(Head const &v, T const &...a) {

  if(sizeof...(a) == 0) {

    cout << v;

  } else {

    cout << v << " ";

  }

  output__(a...);

}



int main(){

  int c[3][3];

  rep(i, 3) rep(j, 3) {

    cin >> c[i][j];

  }



  int a[3];

  int b[3];

  rep(i, 3) {

    a[i] = c[0][i];

    b[i] = c[i][0] - a[0];

  }



  rep(i, 3) rep(j, 3) {

    if(c[j][i] != a[i] + b[j]) {

      out("No") exit(0);

    }

  }

  out("Yes");

}


// Fastest known solution for this problem: