#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n, T;
pair<int, pair<int, int> > p[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int q;
  cin >> q;
  while (q--) {
    cin >> n >> T;
    for (int i = 1; i <= n; i++)
      cin >> p[i].first >> p[i].second.first >> p[i].second.second;
    sort(p + 1, p + n + 1);
    int l = T, r = T;
    bool success = true;
    for (int i = 1; i <= n; i++) {
      if (p[i].second.first >= r) {
        if (p[i].second.first - r > p[i].first - p[i - 1].first) {
          success = false;
          break;
        }
        r = min(r + p[i].first - p[i - 1].first, p[i].second.second);
        l = p[i].second.first;
      } else if (p[i].second.first >= l) {
        if (p[i].second.second >= r) {
          l = p[i].second.first;
          r = min(r + p[i].first - p[i - 1].first, p[i].second.second);
        } else {
          l = p[i].second.first;
          r = p[i].second.second;
        }
      } else {
        if (p[i].second.second >= r) {
          l = max(l - (p[i].first - p[i - 1].first), p[i].second.first);
          r = min(r + p[i].first - p[i - 1].first, p[i].second.second);
        } else if (p[i].second.second >= l) {
          l = max(l - (p[i].first - p[i - 1].first), p[i].second.first);
          r = p[i].second.second;
        } else {
          if (l - p[i].second.second > p[i].first - p[i - 1].first) {
            success = false;
            break;
          }
          l = max(l - (p[i].first - p[i - 1].first), p[i].second.first);
          r = p[i].second.second;
        }
      }
    }
    cout << (success ? "YES" : "NO") << endl;
  }
  return 0;
}
