#include <bits/stdc++.h>
using namespace std;
const int N = 105;
struct node {
  int t, l, h;
} a[N];
bool cmp(const node &a, const node &b) { return a.t < b.t; }
int main() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i) {
      scanf("%d%d%d", &a[i].t, &a[i].l, &a[i].h);
    }
    sort(a + 1, a + n + 1, cmp);
    int l = m, h = m;
    bool fg = 1;
    for (int i = 1; i <= n; ++i) {
      l -= (a[i].t - a[i - 1].t);
      h += (a[i].t - a[i - 1].t);
      l = max(l, a[i].l);
      h = min(h, a[i].h);
      if (l > h) {
        fg = 0;
        break;
      }
    }
    if (fg)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
