import std.stdio, std.algorithm, std.range, std.array, std.conv, std.string;

void main() {
    int[][] C;
    foreach (i; 0..3) {
        C ~= readln.split.to!(int[]);
    }
    writeln(
        C[0][1] - C[0][0] == C[1][1] - C[1][0]
     && C[0][1] - C[0][0] == C[2][1] - C[2][0]
     && C[0][2] - C[0][0] == C[1][2] - C[1][0]
     && C[0][2] - C[0][0] == C[2][2] - C[2][0]
     ? "Yes" : "No");
}
