#include<iostream>
using namespace std;
int a,b,c,d,e,f,z;
int main(){
    cin>>a>>b>>c;
    cin>>d>>e>>f;
    if(a-b!=d-e||b-c!=e-f||a-d!=b-e||b-e!=c-f)z=1;
    cin>>d>>e>>f;
    if(a-b!=d-e||b-c!=e-f||a-d!=b-e||b-e!=c-f)z=1;
    cout<<(z?"No":"Yes")<<endl;
    return 0;
}