#include <bits/stdc++.h>
int main() {
  int n, t[10000], x[10000], y[10000];
  int j, k = 0;
  scanf("%d", &n);
  for (j = 0; j < n; j++) {
    scanf("%d %d %d", &t[j], &x[j], &y[j]);
    if ((x[j - 1] + 1) == x[j] || (x[j - 1] - 1) == x[j] ||
        (y[j - 1] + 1) == y[j] || (y[j - 1] - 1) == y[j])
      k = 1;
    else
      k = 0;
  }
  if (k == 1)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
