c={}
for i=1,3 do
    c[i]={}
    for j=1,3 do
        c[i][j]=io.read("*n")
    end
end

checker={}
for i=1,3 do
    checker[i]={}
    for j=2,3 do
        x=c[i][j-1]-c[i][j]
        table.insert(checker[i],x)
    end
end

takahashi=true
for i=2,3 do
    if checker[i][1]~=checker[i-1][1] or checker[i][2]~=checker[i-1][2] then
        takahashi=false
    end
end

if takahashi then
    print("Yes")
else
    print("No")
end