#include <bits/stdc++.h>
using namespace std;
long const M = 1e9 + 7;
void solve() {
  long long n, m;
  cin >> n >> m;
  long long t[n + 1], l[n + 1], h[n + 1];
  for (int i = 1; i <= n; ++i) {
    cin >> t[i] >> l[i] >> h[i];
  }
  t[0] = 0;
  h[0] = m;
  l[0] = m;
  long long currmin = m;
  long long currmax = m;
  for (int i = 1; i <= n; ++i) {
    currmin -= (t[i] - t[i - 1]);
    currmax += (t[i] - t[i - 1]);
    if (l[i] > currmax or h[i] < currmin) {
      cout << "NO" << endl;
      ;
      return;
    }
    currmin = max(currmin, l[i]);
    currmax = min(currmax, h[i]);
  }
  cout << "YES" << endl;
  ;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
