#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    vector<pair<long long, pair<long long, long long>>> v;
    for (int i = 0; i < n; i++) {
      int x, y, z;
      cin >> x >> y >> z;
      v.push_back(make_pair(x, make_pair(y, z)));
    }
    int l = 0;
    long long mn = m, mx = m;
    for (int i = 0; i < n; i++) {
      if (i == 0) {
        mn = mn - v[i].first;
        mx = mx + v[i].first;
      } else {
        mn = mn - (v[i].first - v[i - 1].first);
        mx = mx + (v[i].first - v[i - 1].first);
      }
      if (v[i].second.first <= mx && mn <= v[i].second.second) {
        mn = max(mn, v[i].second.first);
        mx = min(mx, v[i].second.second);
      } else {
        l = 1;
        break;
      }
    }
    if (l == 1) {
      cout << "NO";
    } else {
      cout << "YES";
    }
    cout << endl;
  }
}
