#include <bits/stdc++.h>
using namespace std;
int future(const vector<pair<int, pair<int, int> > > &vec, int i) {
  for (int j = i + 1; j < static_cast<int>(vec.size()); j++) {
    if (vec[j].second.first >= vec[i].second.second)
      return 1;
    else if (vec[j].second.second <= vec[i].second.first)
      return -1;
  }
  return 0;
}
int main() {
  int q, n, m, i, t, h, l, time, xl, xh, ans;
  vector<pair<int, pair<int, int> > > vec;
  cin >> q;
  while (q--) {
    time = 0;
    cin >> n >> m;
    for (i = 0; i < n; i++) {
      cin >> t >> l >> h;
      vec.push_back({t, {l, h}});
    }
    ans = 1;
    xl = xh = m;
    for (i = 0; i < n; i++) {
      l = xl - vec[i].first;
      if (i) l += vec[i - 1].first;
      h = xh + vec[i].first;
      if (i) h -= vec[i - 1].first;
      if (l > vec[i].second.second || h < vec[i].second.first) {
        ans = 0;
        break;
      }
      if (l > vec[i].second.first && h < vec[i].second.second) {
        xl = l;
        xh = h;
        continue;
      }
      if (l <= vec[i].second.first && h >= vec[i].second.second) {
        xl = vec[i].second.first;
        xh = vec[i].second.second;
        continue;
      }
      if (l <= vec[i].second.first) {
        xl = vec[i].second.first;
        xh = h;
        continue;
      }
      xl = l;
      xh = vec[i].second.second;
    }
    if (ans)
      puts("YES");
    else
      puts("NO");
    time += vec[i].first;
    vec.clear();
  }
  return 0;
}
