open Batteries;;
let () =
  let c11,c12,c13 = Scanf.scanf "%d %d %d\n" (fun x y z -> x,y,z) in
  let c21,c22,c23 = Scanf.scanf "%d %d %d\n" (fun x y z -> x,y,z) in
  let c31,c32,c33 = Scanf.scanf "%d %d %d\n" (fun x y z -> x,y,z) in
  let condlist =
    (c11-c12 = c21-c22 && c21-c22 = c31-c32)
    :: (c12-c13 = c22-c23 && c22-c23 = c32-c33) 
    :: (c11-c21 = c12-c22 && c12-c22 = c13-c23)
    :: (c21-c31 = c22-c32 && c22-c32 = c23-c33)
    :: (2*(c11+c22+c33) = c21+c31+c32+c12+c13+c23)
    :: []
  in
  let ans = if List.fold_left (&&) true condlist = true then "Yes" else "No" in
  print_string ans
;;
