#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n, m;
    cin >> n >> m;
    vector<pair<int, pair<int, int> > > v;
    for (int i = 0; i < n; i++) {
      int t, l, r;
      cin >> t >> l >> r;
      v.push_back(make_pair(t, make_pair(l, r)));
    }
    vector<int> mi(n);
    vector<int> ma(n);
    mi[0] = max(m - v[0].first, v[0].second.first);
    ma[0] = min(m + v[0].first, v[0].second.second);
    int cnt = 1;
    if (mi[0] > v[0].second.second || ma[0] < v[0].second.first) cnt = 0;
    for (int i = 1; i < n; i++) {
      int temp = v[i].first - v[i - 1].first;
      mi[i] = max(mi[i - 1] - temp, v[i].second.first);
      ma[i] = min(ma[i - 1] + temp, v[i].second.second);
      if (mi[i] > v[i].second.second || ma[i] < v[i].second.first) cnt = 0;
    }
    if (cnt == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
