function main(argString) {
  var input = argString.split('\n');
  var course = [ [0, 0, 0] ];
  for (var i = 1; i < input.length; i++) {
   course.push(input[i].split(' ').map(v => Number(v)));
  }
  for (var i = 1; i < course.length; i++) {
    var before = course[i - 1];
    var after = course[i];
    var step = after[0] - before[0];
    var moved = Math.abs(after[1] - before[1]) + Math.abs(after[2] - before[2]);
    if (moved > step || moved % 2 !== step % 2) {
      console.log('NO');
      return;
    }
  }
  console.log('YES');
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));
