#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;

int main() {
    int a, b, c, d, e, f, g, h, i;
    cin >> a >> b >> c >> d >> e >> f >> g >> h >> i;
    if (a + e == b + d && b + f == c + e && d + h == e + g && e + i == f + h){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}