#include <bits/stdc++.h>
using namespace std;
struct fun {
  int in, lt, ht;
};
bool cmp(fun a, fun b) {
  if (a.in == b.in && a.lt == b.lt) {
    return a.ht < b.ht;
  } else if (a.in == b.in) {
    return a.lt < b.lt;
  }
  return a.in < b.in;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    vector<fun> v;
    for (int i = 0; i < n; i++) {
      fun f;
      cin >> f.in >> f.lt >> f.ht;
      v.push_back(f);
    }
    sort(v.begin(), v.end(), cmp);
    bool res = true;
    int mx = m, mn = m, prev = 0;
    for (int i = 0; i < n; i++) {
      int k = v[i].in - prev;
      if (!(mn - k <= v[i].ht && mx + k >= v[i].lt)) {
        res = false;
        break;
      }
      mn = max(mn - k, v[i].lt);
      mx = min(mx + k, v[i].ht);
      prev = v[i].in;
    }
    if (res) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
