#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q;
  cin >> q;
  while (q--) {
    int n, mmin, mmax, tprev = 0, t, lo, hi;
    cin >> n >> mmin;
    mmax = mmin;
    string sol = "YES";
    for (int i = 0; i < n; i++) {
      cin >> t >> lo >> hi;
      mmax = min(hi, mmax + t - tprev);
      mmin = max(lo, mmin - t + tprev);
      tprev = t;
      if (mmin > mmax) {
        sol = "NO";
      }
    }
    cout << sol << "\n";
  }
}
