#include <bits/stdc++.h>
using namespace std;
typedef struct _node {
  long long t, l, h;
  _node(long long x, long long y, long long z) {
    t = x;
    l = y;
    h = z;
  }
} _node;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, initial;
    cin >> n >> initial;
    vector<struct _node> a;
    for (int i = 0; i < n; i++) {
      long long t, l, h;
      cin >> t >> l >> h;
      a.push_back(_node(t, l, h));
    }
    long long t = 0, initial_l = initial, initial_r = initial, flag = 1;
    for (int i = 0; i < n; i++) {
      long long have = a[i].t - t;
      t = a[i].t;
      initial_l -= have;
      initial_r += have;
      initial_l = max(initial_l, a[i].l);
      initial_r = min(initial_r, a[i].h);
      if (initial_r < a[i].l || initial_l > a[i].h) {
        flag = 0;
        break;
      }
    }
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
