
open Scanf
open Printf
open List

let read_int () = scanf " %d" (fun x -> x)

let rec read_ints n =
  if n = 0
  then []
  else let a = scanf " %d" (fun x -> x) in a :: read_ints (n-1)

let () =
  let (c11::c12::c13::_) = read_ints 3 in
  let (c21::c22::c23::_) = read_ints 3 in
  let (c31::c32::c33::_) = read_ints 3 in
  let ok = ref true in
  ok := !ok && (c11-c12 = c21-c22) && (c21-c22 = c31-c32);
  ok := !ok && (c12-c13 = c22-c23) && (c22-c23 = c32-c33);
  ok := !ok && (c11-c21 = c12-c22) && (c12-c22 = c13-c23);
  ok := !ok && (c21-c31 = c22-c32) && (c22-c32 = c23-c33);
  print_endline (if !ok then "Yes" else "No") 
