#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q;
  cin >> q;
  while (q--) {
    int n;
    long long int m;
    cin >> n >> m;
    long long int t[n + 1], l[n + 1], r[n + 1];
    t[0] = 0;
    for (int i = 1; i <= n; i++) cin >> t[i] >> l[i] >> r[i];
    long long int al[n + 1], ar[n + 1];
    long long int left = m, right = m;
    al[0] = m;
    ar[0] = m;
    int i;
    for (i = 1; i <= n; i++) {
      right = ar[i - 1] + t[i] - t[i - 1];
      left = al[i - 1] - t[i] + t[i - 1];
      if (right > r[i]) {
        if (left > r[i])
          break;
        else {
          al[i] = max(left, l[i]);
          ar[i] = r[i];
        }
      } else {
        if (right < l[i])
          break;
        else {
          al[i] = max(left, l[i]);
          ar[i] = right;
        }
      }
    }
    if (i == n + 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
