#include <bits/stdc++.h>
using namespace std;

/*int main() {
    int n, a;
    cin >> n >> a;
    if (n % 500 > a) cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}*/

/*int main() {
    int n;
    cin >> n;
    priority_queue<int> pq;
    for (int i = 0; i < n; i++) {
        int val;
        cin >> val;
        pq.push(val);
    }
    int alice = 0, bob = 0;
    bool b = 1;
    while (!pq.empty()) {
        if (b) {
            alice += pq.top();
        } else {
            bob += pq.top();
        }
        b = !b;
        pq.pop();
    }
    cout << alice - bob << endl;
    return 0;
}*/

int main() {
    int c[3][3], a[3], b[3], sum = 0;
    memset(a, -1, sizeof a);
    memset(b, -1, sizeof b);
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> c[i][j];
        }
    }
    bool possible = 0;
    for (int i = 0; i <= 100; i++) {
        a[0] = i;
        b[0] = c[0][0] - a[0];
        if (b[0] < 0) continue;
        for (int j = 0; j <= 100; j++) {
            a[1] = j;
            b[1] = c[1][1] - j;
            if (b[0] + a[1] != c[1][0]) continue;
            if (b[1] + a[0] != c[0][1]) continue;
            if (b[1] < 0) continue;
            for (int k = 0; k <= 100; k++) {
                a[2] = k;
                b[2] = c[2][2] - k;
                if (b[2] < 0) continue;
                if (a[0] + b[2] != c[0][2]) continue;
                if (a[1] + b[2] != c[1][2]) continue;
                if (a[2] + b[0] != c[2][0]) continue;
                if (a[2] + b[1] != c[2][1]) continue;
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

/*typedef pair<pair<int, int>, int> iii;

int main() {
    int h, w, blocked, min_dist;
    bool grid[52][52];
    cin >> h >> w;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            char c;
            cin >> c;
            grid[i][j] = c == '.';
            if (!grid[i][j]) {
                blocked++;
            }
        }
    }
    queue<iii> q;
    q.push(iii(make_pair(0, 0), 0));
    bool vis[52][52];
    int dist[52][52];
    memset(dist, 0, sizeof dist);
    memset(vis, 0, sizeof vis);
    vis[0][0] = 1;
    dist[0][0] = 0;
    while (!q.empty()) {
        iii front = q.front(); q.pop();
        int r = front.first.first, c = front.first.second, d = front.second;
        dist[r][c] = d;
        if (r < 0 || c < 0 || r >= h || c >= w) continue;
        if (r == h - 1 && c == w - 1) {
            min_dist = d;
            break;
        }
        if (r > 0 && !vis[r - 1][c] && grid[r - 1][c]) {
            q.push(iii(make_pair(r - 1, c), d + 1));
            vis[r - 1][c] = 1;
        }
        if (r < h - 1 && !vis[r + 1][c] && grid[r + 1][c]) {
            q.push(iii(make_pair(r + 1, c), d + 1));
            vis[r + 1][c] = 1;
        }
        if (c > 0 && !vis[r][c - 1] && grid[r][c - 1]) {
            q.push(iii(make_pair(r, c - 1), d + 1));
            vis[r][c - 1] = 1;
        }
        if (c < w - 1 && !vis[r][c + 1] && grid[r][c + 1]) {
            q.push(iii(make_pair(r, c + 1), d + 1));
            vis[r][c + 1] = 1;
        }
    }
    if (!vis[h - 1][w - 1]) cout << -1 << endl;
    else cout << h * w - blocked - min_dist - 1 << endl;
    return 0;
}*/

Measured memory_bytes: 256