local t = {}
for i = 1, 9 do
  t[i] = io.read("*n")
end
local a, b = t[2] - t[1], t[3] - t[2]
local f = true
f = f and a == t[5] - t[4] and b == t[6] - t[5]
f = f and a == t[8] - t[7] and b == t[9] - t[8]

a, b = t[4] - t[1], t[7] - t[4]
f = f and a == t[5] - t[2] and b == t[8] - t[5]
f = f and a == t[6] - t[3] and b == t[9] - t[6]
print(f and "Yes" or "No")
