function Main(input) {
  input = input.split("\n");
  var N = ~~input[0];
  var t = Array(N);
  var x = Array(N);
  var y = Array(N);

  for(var i =0; i < input.length-2; i++){
    t[i] = ~~input[i+1].split(" ")[0];
    x[i] = ~~input[i+1].split(" ")[1];
    y[i] = ~~input[i+1].split(" ")[2];
  }
  var AtCoDeer = function(t,x,y){
    this.plan = {
      t:t,
      x:x,
      y:y
    }
    this.max_t=Math.max(...t);
    this.max_x=Math.max(...x);
    this.max_y=Math.max(...y);
    this.dp = [...Array(this.max_t+1).keys()].map(x => [...Array(this.max_x+1).keys()].map(x => [...Array(this.max_y+1).keys()].map(x => 0)))
    this.dp[0][0][0]=1;
  }

  AtCoDeer.prototype = {
    travel: function(t, x, y){
      if(t > this.max_t || t < 0 || x > this.max_x || x < 0 || y > this.max_y || y < 0){
        return false;
      }else if(t == 0 && x == 0 && y == 0){
        return true;
      }

      if(x < this.max_x-1 && t != 0) if(this.dp[t-1][x+1][y] == 1){this.dp[t][x][y]=1; return true;}
      if(x > 0 && t != 0) if(this.dp[t-1][x-1][y] == 1){this.dp[t][x][y]=1; return true;}
      if(y < this.max_y-1 && t != 0) if(this.dp[t-1][x][y+1] == 1){this.dp[t][x][y]=1; return true;}
      if(y > 0 && t != 0) if(this.dp[t-1][x][y-1] == 1){this.dp[t][x][y]=1; return true;}
      return this.travel(t-1, x+1, y) || this.travel(t-1, x-1, y) || this.travel(t-1, x, y+1) || this.travel(t-1, x, y-1)
    }
  }
  var atcodeer = new AtCoDeer(t,x,y);

  var flag = true;
  for(var i = 0; i < atcodeer.plan.t.length; i++){
    if(atcodeer.travel(atcodeer.plan.t[i],atcodeer.plan.x[i],atcodeer.plan.y[i]) == false) flag=false;
  }
  if(flag == true){
    console.log("YES");
  }else{
    console.log("NO");
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));