#include <bits/stdc++.h>
using namespace std;
template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  while (q--) {
    int n, m;
    cin >> n >> m;
    map<long long, pair<long long, long long> > MP;
    for (int i = 0; i <= n; i++) {
      long long t, l, h;
      if (i < n)
        cin >> t >> l >> h;
      else {
        t = 0;
        l = h = m;
      }
      if (MP.find(t) == MP.end())
        MP[t] = {l, h};
      else {
        auto [a, b] = MP[t];
        MP[t] = {max(a, l), min(b, h)};
      }
    }
    long long last = 0;
    auto [l, h] = MP[0];
    bool ok = (l <= h);
    MP.erase(0);
    for (auto [t, p] : MP) {
      auto [a, b] = p;
      long long d = t - last;
      a = max(a, l - d);
      b = min(b, h + d);
      ok &= (a <= b);
      last = t;
      l = a, h = b;
    }
    cout << (ok ? "YES\n" : "NO\n");
  }
  return 0;
}
