#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    int n, m;
    cin >> n >> m;
    vector<int> t(n), l(n), r(n);
    for (int i = 0; i < n; ++i) {
      cin >> t[i] >> l[i] >> r[i];
    }
    int lo = m, hi = m;
    bool ok = 1;
    for (int i = 0; i < n; ++i) {
      int tdiff = t[i] - (i == 0 ? 0 : t[i - 1]);
      int L = max(lo - tdiff, l[i]);
      int R = min(hi + tdiff, r[i]);
      if (L > R) {
        ok = 0;
        break;
      }
      lo = L;
      hi = R;
    }
    puts(ok ? "YES" : "NO");
  }
}
