#include <bits/stdc++.h>
using namespace std;
long long dx[] = {0, 0, 1, -1};
long long dy[] = {1, -1, 0, 0};
struct node {
  long long t, x, y;
} a[1005];
long long n, m;
void sol() {
  long long cnt = 1, flag = 0;
  for (int i = 2; i <= n; i++) {
    if (a[i].t == a[cnt].t) {
      if (a[cnt].y < a[i].x || a[i].y < a[cnt].x) {
        flag = 1;
        break;
      }
      a[cnt].x = max(a[i].x, a[cnt].x);
      a[cnt].y = min(a[i].y, a[cnt].y);
    } else
      a[++cnt] = a[i];
  }
  if (flag) {
    cout << "NO" << endl;
    return;
  }
  flag = 0;
  long long l = m, r = m, t = 0;
  for (int i = 1; i <= cnt; i++) {
    long long ti = a[i].t - t;
    l -= ti;
    r += ti;
    if (r < a[i].x || a[i].y < l) {
      flag = 1;
      break;
    }
    l = max(l, a[i].x);
    r = min(r, a[i].y);
    t = a[i].t;
  }
  if (flag)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> a[i].t >> a[i].x >> a[i].y;
    sol();
  }
  return 0;
}
