let () =
  let css = Array.init 3 (fun _ ->
    Array.init 3 (fun _ ->
      Scanf.scanf "%d " (fun c -> c))) in
  Array.init 3 (fun i ->
    Array.init 3 (fun j ->
      css.(i).(j) (* a_i + b_j *)
      - css.((i + 1) mod 3).(j) (* a_{i + 1} + b_j *))
    |> Array.to_list
    |> (fun (a :: as_) -> List.for_all (( = ) a) as_))
  |> Array.to_list
  |> List.for_all (fun b -> b)
  |> (function true -> "Yes" | _ -> "No")
  |> print_endline