#include <bits/stdc++.h>
using namespace std;
bool sortbysec(const pair<char, long long int> &a,
               const pair<char, long long int> &b) {
  return (a.second < b.second);
}
long long int highest2(long long int n) {
  long long int x = n;
  while (n) {
    x = n;
    n = n & (n - 1);
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int m, q, row, col, x, a, b, n, i, p, j, p0, p1, mno, R, r, br,
      count = 0;
  cin >> q;
  while (q--) {
    bool bo = true;
    cin >> n >> m;
    long long int l[n], h[n], t[n], mmin, mmax, prevt = 0;
    mmin = m;
    mmax = m;
    for (long long int i = 0; i < n; i++) cin >> t[i] >> l[i] >> h[i];
    count = 0;
    for (long long int i = 0; i < n; i++) {
      x = t[i] - prevt;
      mmin = max(l[i], mmin - x);
      mmax = min(h[i], mmax + x);
      prevt = t[i];
      if (mmin > h[i] || mmax < l[i]) {
        cout << "NO" << endl;
        goto u;
      }
    }
    cout << "YES" << endl;
  u:;
  }
  return 0;
}
