#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int M1 = 998244353;
long long int power(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = res * x;
    x = x * x;
    y = y >> 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  while (q--) {
    int n, tl, th;
    cin >> n >> tl;
    th = tl;
    int t = 0;
    vector<pair<int, pair<int, int>>> v;
    for (int i = 0; i < n; i++) {
      int a, b, c;
      cin >> a >> b >> c;
      v.push_back({a, {b, c}});
    }
    sort(v.begin(), v.end());
    int flag = 1;
    for (int i = 0; i < n; i++) {
      int a = v[i].first;
      int b = v[i].second.first;
      int c = v[i].second.second;
      int x = tl - (a - t);
      int y = th + a - t;
      if (!((x <= b && y >= b) || (y >= c && x <= c) || y <= c && x >= b)) {
        flag = 0;
        break;
      }
      tl = max(b, tl - (a - t));
      th = min(c, th + (a - t));
      t = a;
    }
    if (flag)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
}
