#include <bits/stdc++.h>
using namespace std;
void fastio() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
void one();
int main() {
  fastio();
  int t = 1;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    one();
  }
  return 0;
}
long long tmax[123];
long long tmin[123];
void one() {
  int n, temp;
  cin >> n >> temp;
  tmax[0] = tmin[0] = temp;
  vector<pair<int, pair<int, int>>> v;
  for (int i = 0; i < n; ++i) {
    int t, l, h;
    cin >> t >> l >> h;
    v.push_back({t, {l, h}});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; ++i) {
    long long t = v[i].first;
    long long l = v[i].second.first;
    long long h = v[i].second.second;
    long long tprev = i == 0 ? 0 : v[i - 1].first;
    long long timePassed = t - tprev;
    tmin[i + 1] = tmin[i] - timePassed;
    tmax[i + 1] = tmax[i] + timePassed;
    if (tmax[i + 1] < l) {
      cout << "NO" << endl;
      return;
    }
    if (tmin[i + 1] > h) {
      cout << "NO" << endl;
      return;
    }
    tmin[i + 1] = max(l, tmin[i + 1]);
    tmax[i + 1] = min(h, tmax[i + 1]);
  }
  cout << "YES" << endl;
}
