#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
const long long N = 1e6 + 10;
const long long IM = 1e15 + 37;
const long double PI = 3.1415926535897932384;
void PV(vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << "\n";
}
void PVV(vector<pair<long long, long long> > v) {
  for (long long i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << "\n";
}
void PA(long long v[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cout << v[i] << ' ';
  cout << "\n";
}
void IN(long long a[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cin >> a[i];
}
inline void PP(long long n) { cout << n << " "; }
inline void PP(long long n, long long m) { cout << n << " " << m << "\n"; }
inline void PP(long long n, long long m, long long q) {
  cout << n << " " << m << " " << q << "\n";
}
inline void PP(long long n, long long m, long long q, long long u) {
  cout << n << " " << m << " " << q << " " << u << "\n";
}
inline void op() {}
struct ppl {
  long long t;
  long long l;
  long long r;
};
signed main() {
  op();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, x, y, u, l;
  long long t;
  cin >> t;
  while (t--) {
    i = j = x = y = u = l = 0;
    long long n, m;
    cin >> n >> m;
    ppl p[n];
    long long r;
    l = r = m;
    for (i = 0; i < n; i++) cin >> p[i].t >> p[i].l >> p[i].r;
    x = 0;
    bool ok = 1;
    for (i = 0; i < n; i++) {
      y = p[i].t - x;
      r = r + y;
      l = l - y;
      if ((r >= p[i].l && r <= p[i].r) || (l >= p[i].l && l <= p[i].r) ||
          (l <= p[i].l && r >= p[i].r) || (l >= p[i].l && r <= p[i].r)) {
        l = max(l, p[i].l);
        r = min(r, p[i].r);
      } else {
        ok = 0;
        break;
      }
      x = p[i].t;
    }
    if (ok)
      cout << ("YES") << "\n";
    else
      cout << ("NO") << "\n";
  }
  return 0;
}
