#include <bits/stdc++.h>
using namespace std;
struct user {
  long long t, l, h;
};
bool cmp(user a, user b) { return a.t < b.t; }
int main() {
  do {
    ios::sync_with_stdio(false);
    std::cin.tie(0);
  } while (0);
  int q;
  cin >> q;
  while (q--) {
    long long n, m;
    cin >> n >> m;
    vector<user> all(n);
    for (long long i = 0; i < n; i++) {
      cin >> all[i].t >> all[i].l >> all[i].h;
    }
    sort(all.begin(), all.end(), cmp);
    bool flag{};
    long long lower = m, upper = m, pre_t{};
    for (long long i = 0; i < n; i++) {
      lower -= all[i].t - pre_t;
      upper += all[i].t - pre_t;
      pre_t = all[i].t;
      if (lower > all[i].h || upper < all[i].l) {
        flag = true;
        break;
      } else if (lower == all[i].h) {
        upper = all[i].h;
      } else if (upper == all[i].l) {
        lower = all[i].l;
      } else {
        lower = max(lower, all[i].l);
        upper = min(upper, all[i].h);
      }
    }
    if (!flag) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
