#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tt, i;
  cin >> tt;
  while (tt--) {
    long long n, m, flag = 0;
    cin >> n >> m;
    vector<pair<long long, pair<long long, long long>>> v(n);
    for (i = 0; i < n; i++) {
      cin >> v[i].first >> v[i].second.first >> v[i].second.second;
    }
    long long lm = m, rm = m, temp = 0, temp1 = 0;
    for (i = 0; i < n; i++) {
      long long t = v[i].first;
      long long l = v[i].second.first;
      long long r = v[i].second.second;
      temp = (t - temp1);
      lm -= temp;
      rm += temp;
      lm = max(lm, l);
      rm = min(rm, r);
      temp1 = t;
      if (rm < lm) {
        flag = 1;
        break;
      }
      if (l <= rm) {
        continue;
      } else {
        flag = 1;
        break;
      }
    }
    if (flag == 1)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
