solver::[[Int]]->Bool
solver [[c11,c12,c13],[c21,c22,c23],[c31,c32,c33]]=
        and [(c21-c11)==(c22-c12),(c22-c12)==(c23-c13)
            ,(c31-c21)==(c32-c22),(c32-c22)==(c33-c23)
            ,(c12-c11)==(c22-c21),(c22-c21)==(c32-c31)
            ,(c13-c12)==(c23-c22),(c23-c22)==(c33-c32)]

main::IO()
main=do
  a1<-getLine
  a2<-getLine
  a3<-getLine
  let mat = (map (map read)) (map words [a1,a2,a3])
  putStr (if solver mat then "Yes\n" else "No\n")