#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  int high = m, low = m, tom = 0, tim, hi, lo;
  bool check = true;
  for (int i = 0; i < n; i++) {
    cin >> tim;
    high += tim - tom;
    low -= tim - tom;
    tom = tim;
    cin >> lo >> hi;
    high = min(hi, high);
    low = max(lo, low);
    if (low > high) check = false;
  }
  if (check)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  while (n--) solve();
  return 0;
}
