#include <bits/stdc++.h>
using namespace std;
typedef struct _a {
  int t;
  int l;
  int h;
} A;
A a[101];
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n, m;
    cin >> n >> m;
    a[0].t = 0;
    a[0].l = a[0].h = m;
    for (int i = 1; i <= n; ++i) cin >> a[i].t >> a[i].l >> a[i].h;
    int l, h;
    l = h = m;
    bool b = true;
    for (int i = 1; i <= n; ++i) {
      int t = a[i].t - a[i - 1].t;
      h += t;
      l -= t;
      if (h < a[i].l || l > a[i].h) {
        b = false;
        break;
      }
      h = (h < a[i].h) ? h : a[i].h;
      l = (l > a[i].l) ? l : a[i].l;
    }
    if (b)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
