#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
const int mo = 1000000007;
long long n, m, ans, q;
struct jj {
  long long l, r, t;
} a[110];
bool cmp(jj x, jj y) { return x.t < y.t; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> q;
  while (q--) {
    cin >> n >> m;
    int flg = 0;
    for (int i = (1); i <= (n); ++i) cin >> a[i].t >> a[i].l >> a[i].r;
    sort(a + 1, a + n + 1, cmp);
    long long la = m, ra = m;
    for (int i = (1); i <= (n); ++i) {
      if (flg) break;
      ra = ra + a[i].t - a[i - 1].t, la = la - a[i].t + a[i - 1].t;
      if (la > a[i].r || ra < a[i].l) flg = 1;
      ra = min(ra, a[i].r);
      la = max(la, a[i].l);
    }
    if (flg)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
