main = do
  mat <- map read . words <$> getContents
  let ans = any (check mat) [-1000 .. 1000]
  putStrLn $ if ans then "Yes" else "No"

check [c11,c12,c13,c21,c22,c23,c31,c32,c33] x = a2+b2==c22 && a2+b3==c23 && a3+b1==c31 && a3+b2==c32 && a3+b3==c33
  where
    b1 = c11 - x
    b2 = c12 - x
    b3 = c13 - x
    a2 = c21 - b1
    a3 = c31 - b1