#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  for (long long int u = 0; u < t; u++) {
    int n, init_temp;
    cin >> n >> init_temp;
    int t[n], l[n], h[n];
    for (long long int i = 0; i < n; i++) {
      cin >> t[i] >> l[i] >> h[i];
    }
    int wrong = 0;
    int prev = 0;
    int i;
    int mn = init_temp, mx = init_temp;
    for (i = 0; i < n; i++) {
      mx += t[i] - prev;
      mn -= t[i] - prev;
      if (mx < l[i] || mn > h[i]) {
        wrong++;
        break;
      }
      mx = min(mx, h[i]);
      mn = max(mn, l[i]);
      prev = t[i];
    }
    if (wrong == 0)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
