#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> q;
  while (q--) {
    int n, m;
    cin >> n >> m;
    vector<int> t(n), l(n), h(n);
    for (int i = 0; i < n; i++) {
      cin >> t[i] >> l[i] >> h[i];
    }
    if (m + t[0] < l[0] || m - t[0] > h[0]) {
      cout << "NO\n";
      continue;
    }
    bool ans = true;
    int low = m - t[0], high = m + t[0];
    low = max(low, l[0]);
    high = min(high, h[0]);
    for (int i = 1; i < n; i++) {
      int x = t[i] - t[i - 1];
      if (low - x > h[i] || high + x < l[i]) {
        ans = false;
        break;
      }
      low = max(low - x, l[i]);
      high = min(high + x, h[i]);
    }
    cout << (ans ? "YES" : "NO") << '\n';
  }
  return 0;
}
