console.log((args=>{
  const c = args.trim().split`\n`.map(r=>r.split` `.map(v=>v|0));
  for ( let i = 1; i < 3; i++ ) {
    for ( let j = 1; j < 3; j++ ) {
      if ( c[i][j] - c[i][j-1] !== c[i-1][j] - c[i-1][j-1] ) return 'No';
      if ( c[j][i] - c[j][i-1] !== c[j-1][i] - c[j-1][i-1] ) return 'No';
    }
  }
  return 'Yes';
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
