#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m, i, a, b, c, ui, li, tm;
  cin >> n >> m;
  vector<pair<long long, pair<long long, long long> > > p;
  vector<pair<long long, pair<long long, long long> > >::iterator it;
  for (i = 0; i < n; i++) {
    cin >> a >> b >> c;
    p.push_back(make_pair(a, make_pair(b, c)));
  }
  sort(p.begin(), p.end());
  ui = m, li = m, tm = 0;
  for (it = p.begin(); it != p.end(); it++) {
    li = li - it->first + tm;
    ui = ui + it->first - tm;
    tm = it->first;
    if (li < it->second.first) li = it->second.first;
    if (ui > it->second.second) ui = it->second.second;
    if (ui < it->second.first || li > it->second.second) break;
  }
  if (it == p.end())
    cout << "YES\n";
  else
    cout << "NO\n";
  return;
}
int main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
