local a = {}
for i = 1, 9 do a[i] = io.read("*n") end
if(a[1] + a[5] == a[2] + a[4] and a[1] + a[8] == a[2] + a[7] and a[1] + a[6] == a[3] + a[4] and a[1] + a[9] == a[3] + a[7]) then
    print("Yes") else print("No")
end