#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
	long long a, b, c, d, e, f, g, h, i, j = 0;
	cin >> a >> b >> c >> d >> e >> f >> g >> h >> i;
	if (a - d == b - e && b - e == c - f) {
		if (d - g == e - h && e - h == f - i) {
			cout << "Yes" << endl;
			j++;
		}
	}
	if (j == 0) {
		cout << "No" << endl;
	}
	cin >> e;
}