import std.stdio, std.algorithm, std.range, std.conv, std.meta;
/*
  a1+b1, a1+b2, a1+b3
  a2+b1, a2+b2, a2+b3
  a3+b1, a3+b2, a3+b3
 */
void main() {
    int[3*3] _c;
    ref c(size_t i, size_t j) {
        return _c[i * 3 + j];
    }
    ref ct(size_t i, size_t j) {
        return _c[j * 3 + i];
    }
    foreach (i; 0..3) {
        foreach (j, n; readln.split.map!(to!int).enumerate) {
            c(i, j) = n;
        }
    }
    foreach (f; AliasSeq!(c, ct)) {
        foreach (i; 0..2) {
            foreach (j; i..3) {
                auto d0 = f(i, 0) - f(j, 0); // a[i] - a[j] or b[i] - b[j]
                auto d1 = f(i, 1) - f(j, 1);
                if (d0 != d1) {
                    writeln("No");
                    return;
                }
                auto d2 = f(i, 2) - f(j, 2);
                if (d0 != d2) {
                    writeln("No");
                    return;
                }
            }
        }
    }
    writeln("Yes");
}