#include <bits/stdc++.h>
using namespace std;
long long n, m;
pair<long long, pair<long long, long long> > a[105];
pair<long long, long long> cur;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long q;
  cin >> q;
  while (q--) {
    cin >> n >> m;
    cur = pair<long long, long long>(m, m);
    bool check = 1;
    a[0] = pair<long long, pair<long long, long long> >(
        0, pair<long long, long long>(m, m));
    for (int i = 1; i <= n; i++) {
      cin >> a[i].first >> a[i].second.first >> a[i].second.second;
    }
    sort(a, a + n + 1);
    for (int i = 1; i <= n; i++) {
      long long delta = i == 0 ? a[i].first : a[i].first - a[i - 1].first;
      cur = pair<long long, long long>(cur.first - delta, cur.second + delta);
      cur.first = max(cur.first, a[i].second.first);
      cur.second = min(cur.second, a[i].second.second);
      if (cur.first > cur.second) {
        check = false;
      }
    }
    cout << (check ? "YES" : "NO") << "\n";
  }
  return 0;
}
