#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1LL;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
inline long long readll() {
  long long f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1LL;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
template <class T>
inline void chmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void chmin(T &a, T b) {
  if (a > b) a = b;
}
inline void swap(int &a, int &b) {
  int c = a;
  a = b;
  b = c;
}
using namespace std;
const int N = 233;
int n, m;
struct node {
  int t, l, r;
  node(int _t = 0, int _l = 0, int _r = 0) : t(_t), l(_l), r(_r) {}
} a[N];
inline void wk() {
  n = read();
  m = read();
  int ind = 0;
  for (int i = (1); i <= (n); ++i) {
    a[++ind].t = read();
    a[ind].l = read();
    a[ind].r = read();
    if (a[ind].t == a[ind - 1].t) {
      chmax(a[ind - 1].l, a[ind].l);
      chmin(a[ind - 1].r, a[ind].r);
      --ind;
    }
  }
  int nowt = 0;
  int curl = m, curr = m;
  int fl = 1;
  for (int i = (1); i <= (ind); ++i) {
    int t = a[i].t - nowt;
    if (a[i].l > a[i].r) {
      fl = 0;
      break;
    }
    if (curl > a[i].r) {
      if (t < curl - a[i].r) {
        fl = 0;
        break;
      } else {
        t -= (curl - a[i].r);
        curr = a[i].r;
        curl = max(a[i].r - t, a[i].l);
      }
    } else if (curr < a[i].l) {
      if (t < a[i].l - curr) {
        fl = 0;
        break;
      } else {
        t -= (a[i].l - curr);
        curl = a[i].l;
        curr = min(a[i].r, a[i].l + t);
      }
    } else {
      curl -= t;
      curr += t;
      chmin(curr, a[i].r);
      chmax(curl, a[i].l);
    }
    nowt = a[i].t;
  }
  if (fl == 1)
    puts("YES");
  else
    puts("NO");
}
int main() {
  int T = read();
  while (T--) wk();
  return 0;
}
