#include <bits/stdc++.h>
using namespace std;
struct pp {
  int time;
  int down;
  int up;
} a[105];
bool cmp(pp x, pp y) { return x.time < y.time; }
bool ins(int &a, int &b, int c, int d) {
  int q[4];
  if (c > b) {
    return 0;
  } else if (a > d) {
    return 0;
  } else {
    q[0] = a, q[1] = b, q[2] = c, q[3] = d;
    sort(q, q + 4);
    a = q[1];
    b = q[2];
    return 1;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int f = 0;
    int n, m;
    int up, down;
    cin >> n >> m;
    up = m;
    down = m;
    for (int i = 1; i <= n; i++) cin >> a[i].time >> a[i].down >> a[i].up;
    sort(a + 1, a + n + 1, cmp);
    for (int i = 1; i <= n; i++) {
      up -= a[i].time - a[i - 1].time;
      down += a[i].time - a[i - 1].time;
      if (!ins(up, down, a[i].down, a[i].up)) {
        f = 1;
        break;
      } else {
        ins(up, down, a[i].down, a[i].up);
      }
    }
    if (!f) {
      cout << "YES" << endl;
    } else
      cout << "NO" << endl;
  }
}
