#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    vector<long long> t(n), h(n), l(n);
    for (int i = 0; i < n; i++) cin >> t[i] >> l[i] >> h[i];
    long long current = m;
    long long timereserveu = 0, timereserved = 0;
    bool isok = true;
    for (int i = 0; i < n; i++) {
      long timehv;
      if (i == 0)
        timehv = t[i];
      else
        timehv = t[i] - t[i - 1];
      if (current <= h[i] && current >= l[i]) {
        timereserveu = min(h[i], current + timehv + timereserveu) - current;
        timereserved = current - max(l[i], current - timehv - timereserved);
        continue;
      } else if (current < l[i]) {
        timehv += timereserveu;
        if (current + timehv >= l[i]) {
          timehv -= l[i] - current;
          current = l[i];
          timereserved = 0;
          timereserveu = min(h[i], current + timehv) - current;
        } else {
          isok = false;
          break;
        }
      } else {
        timehv += timereserved;
        if (current - timehv <= h[i]) {
          timehv -= current - h[i];
          current = h[i];
          timereserveu = 0;
          timereserved = current - max(l[i], current - timehv);
        } else {
          isok = false;
          break;
        }
      }
    }
    if (isok)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
