#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
int main(){
	int c11,c12,c13,c21,c22,c23,c31,c32,c33;
	cin>>c11>>c12>>c13>>c21>>c22>>c23>>c31>>c32>>c33;
	cout<<(c21-c11==c22-c12&&c22-c12==c23-c13&&c31-c11==c32-c12&&c32-c12==c33-c13?"Yes":"No")<<endl;
}
