#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 18;
const long long MAX = 100005;
const long long MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) {
  return s << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
istream &operator>>(istream &i, vector<T> &v) {
  for (long long j = (0); j < (v.size()); j++) i >> v[j];
  return i;
}
template <typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1) s << "	";
  }
  return s;
}
template <typename T>
ostream &operator<<(ostream &s, const vector<vector<T>> &vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i] << endl;
  }
  return s;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);
  long long T;
  cin >> T;
  while (T--) {
    long long n, m;
    bool can = true;
    cin >> n >> m;
    long long preM = m;
    long long prem = m;
    long long pret = 0;
    for (long long i = (0); i < (n); i++) {
      long long t, l, r;
      cin >> t >> l >> r;
      long long diff = t - pret;
      pret = t;
      prem -= diff;
      preM += diff;
      if (preM < l) {
        can = false;
      }
      if (r < prem) {
        can = false;
      }
      chmax(prem, l);
      chmin(preM, r);
    }
    cout << ((can) ? "YES" : "NO") << endl;
    ;
  }
  return 0;
}
