#include <iostream>
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 ((e == d+b-a) and (f == d+c-a) and (h == b+g-a) and (i == c+g-a)){
		cout << "Yes";
		return 0;
	}
	cout << "No";
	return 0;
}