void main() {
    int[][] c = new int[][](3, 3);
    foreach (i; 0 .. 3) {
        int[] tmp = readln.split.to!(int[]);
        foreach (j, x; tmp) {
            c[i][j] = x;
        }
    }
    bool ok = true;
    foreach (i; 1 .. 3) {
        int[] diff = new int[3];
        foreach (j; 0 .. 3) {
            diff[j] = c[i][j] - c[i-1][j];
        }
        if (!diff.all!(x => x == diff[0])) {
            ok = false;
        }
    }
    writeln(ok ? "Yes" : "No");
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;