#include <bits/stdc++.h>
using namespace std;
struct Cus {
  int c, l, h;
} cus[105];
int main() {
  int n, m, t, c, l, h;
  cin >> t;
  while (t--) {
    vector<Cus> v2;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
      cin >> cus[i].c >> cus[i].l >> cus[i].h;
      v2.push_back(cus[i]);
    }
    int lt = 0;
    long long ll = m, hh = m;
    bool ok = true;
    for (int i = 0; i < v2.size(); i++) {
      long long low = ll - (v2[i].c - lt);
      long long high = hh + (v2[i].c - lt);
      if (low > v2[i].h || high < v2[i].l) {
        ok = false;
        break;
      }
      ll = max(low, (long long)v2[i].l);
      hh = min(high, (long long)v2[i].h);
      lt = v2[i].c;
    }
    if (ok)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
