'use strict'

function main(s) {

  const table = s.split('\n').slice(0, -1).map(el => el.split(' ').map(x => Number(x)));

  let ans = 'Yes';

  for (let i = 0; i < 2; i++) {
    for (let j = 0; j < 2; j++) {
      const col_diff = ((table[i][j] - table[i][j + 1]) === (table[i + 1][j] - table[i + 1][j + 1]));
      const row_diff = ((table[i][j] - table[i + 1][j]) === (table[i][j + 1] - table[i + 1][j + 1]));
      if (!(col_diff && row_diff)) {
        ans = 'No';
        break;
      } 
    }
  }

  console.log(ans);
}

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