function Main(input){
  var arr = input.split('\n');
  var c = [];
  c.push(arr[0].split(' ').map(a=>Number(a)));
  c.push(arr[1].split(' ').map(a=>Number(a)));
  c.push(arr[2].split(' ').map(a=>Number(a)));

  if((c[0][1]-c[0][0]==c[1][1]-c[1][0])&&
  (c[0][1]-c[0][0]==c[2][1]-c[2][0])&&
  (c[0][2]-c[0][0]==c[1][2]-c[1][0])&&
  (c[0][2]-c[0][0]==c[2][2]-c[2][0])){
    console.log('Yes');
  }else{
    console.log('No');
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
