#include <bits/stdc++.h>
using namespace std;
long long int dist(long long int l, long long int r, long long int x,
                   long long int y) {
  if (y < l) return -1;
  if (x > r) return -1;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long int n, m, t, l, h, mn, mx, last;
    cin >> n >> m;
    vector<pair<long long int, pair<long long int, long long int> > > v;
    v.push_back(make_pair(0, make_pair(0, 0)));
    for (int i = 0; i < n; i++) {
      cin >> t >> l >> h;
      v.push_back(make_pair(t, make_pair(l, h)));
    }
    sort(v.begin() + 1, v.end());
    int i = 0;
    mn = mx = m;
    bool poss = true;
    while (i < n) {
      long long int td = v[i + 1].first - v[i].first;
      mn = mn - td;
      mx = mx + td;
      if (dist(v[i + 1].second.first, v[i + 1].second.second, mn, mx) != 0) {
        poss = false;
        break;
      }
      mn = max(mn, v[i + 1].second.first);
      mx = min(mx, v[i + 1].second.second);
      i++;
    }
    if (poss)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
