#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long int n, m, k = 1, p = 0, t, l, r, lp, rp;
    cin >> n >> m;
    lp = m;
    rp = m;
    for (int i = 1; i <= n; i++) {
      cin >> t >> l >> r;
      lp = lp - (t - p);
      rp = rp + (t - p);
      if ((r - lp >= 0 && rp - l < 0) || (r - lp < 0 && rp - l >= 0)) {
        k = -1;
      }
      lp = max(lp, l);
      rp = min(r, rp);
      p = t;
    }
    if (k == -1)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
}
