// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



// #define int long long

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

#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)

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

#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)

#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)

#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)

#define SORT(v, n) sort(v, v + n);

#define REVERSE(v, n) reverse(v, v+n);

#define vsort(v) sort(v.begin(), v.end());

#define all(v) v.begin(), v.end()

#define mp(n, m) make_pair(n, m);

#define cout(d) cout<<d<<endl;

#define coutd(d) cout<<std::setprecision(10)<<d<<endl;

#define cinline(n) getline(cin,n);

#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);

#define PI (acos(-1))

#define FILL(v, n, x) fill(v, v + n, x);

#define sz(x) long long(x.size())



using ll = long long;

using vi = vector<int>;

using vvi = vector<vi>;

using vll = vector<ll>;

using vvll = vector<vll>;

using pii = pair<int, int>;

using pll = pair<ll, ll>;

using vs = vector<string>;

using vpll = vector<pair<ll, ll>>;

using vtp = vector<tuple<ll,ll,ll>>;

using vb = vector<bool>;



template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



const ll INF = 1e9;

const ll MOD = 1e9+7;

const ll LINF = 1e18;







signed main()

{

  cin.tie( 0 ); ios::sync_with_stdio( false );

  vvll c(3,vll(3));

  rep(i,3) rep(j,3) cin>>c[i][j];

  

  rep(a1,101){

    rep(a2,101){

      rep(b1,101){

        rep(b2,101){

          ll a3=c[2][0]-b1;

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

          if(a1+b1==c[0][0]

          && a1+b2==c[0][1]

          && a2+b1==c[1][0]

          && a2+b2==c[1][1]

          && a2+b3==c[1][2]

          && a3+b2==c[2][1]

          && a3+b3==c[2][2]

          ){

            cout<<"Yes"<<endl;

            return 0;

          }

        }

      }

    }

  }

  cout<<"No"<<endl;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



// #define int long long

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

#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)

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

#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)

#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)

#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)

#define SORT(v, n) sort(v, v + n);

#define REVERSE(v, n) reverse(v, v+n);

#define vsort(v) sort(v.begin(), v.end());

#define all(v) v.begin(), v.end()

#define mp(n, m) make_pair(n, m);

#define cout(d) cout<<d<<endl;

#define coutd(d) cout<<std::setprecision(10)<<d<<endl;

#define cinline(n) getline(cin,n);

#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);

#define PI (acos(-1))

#define FILL(v, n, x) fill(v, v + n, x);

#define sz(x) long long(x.size())



using ll = long long;

using vi = vector<int>;

using vvi = vector<vi>;

using vll = vector<ll>;

using vvll = vector<vll>;

using pii = pair<int, int>;

using pll = pair<ll, ll>;

using vs = vector<string>;

using vpll = vector<pair<ll, ll>>;

using vtp = vector<tuple<ll,ll,ll>>;

using vb = vector<bool>;



template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



const ll INF = 1e9;

const ll MOD = 1e9+7;

const ll LINF = 1e18;







signed main()

{

  cin.tie( 0 ); ios::sync_with_stdio( false );

  vvll c(3,vll(3));

  rep(i,3) rep(j,3) cin>>c[i][j];

  

  ll a1=0;

  ll b1=c[0][0], b2=c[0][1], b3=c[0][2];

  ll a2=c[1][0]-b1, a3=c[2][0]-b1;

  

  if(c[1][1]==a2+b2

    &&c[1][2]==a2+b3

    &&c[2][1]==a3+b2

    &&c[2][2]==a3+b3

  ){

    cout<<"Yes"<<endl;

    return 0;

  }

  

  cout<<"No"<<endl;

}

// Fastest known solution for this problem: