#include <iostream>

using namespace std;

int main() {
	int c[3][3];
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 3; ++j)
			cin >> c[i][j];
	bool flag = true;
	for (int i = 1; i < 3; ++i)
		for (int j = 1; j < 3; ++j)
			if (c[i - 1][j] - c[i - 1][j - 1] != c[i][j] - c[i][j - 1]) flag = false;
	cout << (flag ? "Yes" : "No") << endl;

	return 0;
}