#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n, m, t, l, h;
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d", &n, &m);
    int ti = 0, maxt = m, mint = m, f = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d%d%d", &t, &l, &h);
      if (f) continue;
      maxt += (t - ti);
      mint -= (t - ti);
      maxt = min(maxt, h);
      mint = max(mint, l);
      if (maxt < mint) {
        f = 1;
      }
      ti = t;
    }
    if (f)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
