'use strict'
 
function main(n) {
  let a0 = n.split("\n")[0].split(" ");
  let a1 = n.split("\n")[1].split(" ");
  let a2 = n.split("\n")[2].split(" ");
  let a0SumCheck = (a0.reduce((n,m)=>{return n*1+m*1}))%3;
  let a1SumCheck = (a1.reduce((n,m)=>{return n*1+m*1}))%3;
  let a2SumCheck = (a2.reduce((n,m)=>{return n*1+m*1}))%3;
  let b0SumCheck = (a0[0]*1+a1[0]*1+a2[0]*1)%3;
  let b1SumCheck = (a0[1]*1+a1[1]*1+a2[1]*1)%3;
  let b2SumCheck = (a0[2]*1+a1[2]*1+a2[2]*1)%3;
  let aCheck = ((a0SumCheck == a1SumCheck) && (a1SumCheck == a2SumCheck));
  let bCheck = ((b0SumCheck == b1SumCheck) && (b1SumCheck == b2SumCheck));
  if(aCheck&&bCheck){
  	console.log("Yes");
  } else {
   	console.log("No");
  }
}

 
main(require("fs").readFileSync("/dev/stdin", "utf8"));