#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long inf = 1e18;
long long m_inf = INT_MIN;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  std::cout.unsetf(std::ios::floatfield);
  std::cout.precision(15);
  long long q = 1;
  cin >> q;
  while (q--) {
    long long n, m;
    cin >> n >> m;
    pair<long long, long long> p = make_pair(m, m);
    vector<long long> l(n), h(n), t(n);
    for (long long i = 0; i < n; i++) cin >> t[i] >> l[i] >> h[i];
    bool flag = true;
    long long time = 0;
    for (long long i = 0; i < n; i++) {
      long long diff = t[i] - time;
      time = t[i];
      long long mn = p.first - diff;
      long long mx = p.second + diff;
      if (mx >= l[i])
        p.first = max(mn, l[i]);
      else {
        flag = false;
        break;
      }
      if (mn <= h[i]) {
        p.second = min(mx, h[i]);
      } else {
        flag = false;
        break;
      }
      if (p.first < l[i] || p.second > h[i]) {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "YES" << '\n';
    } else
      cout << "NO\n";
  }
}
