#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    long long int m;
    cin >> n;
    cin >> m;
    long long int mn = m;
    long long int mx = m;
    bool flag = true;
    long long int prev = 0;
    for (int i = 0; i < n; i++) {
      long long int time, l, h;
      cin >> time >> l >> h;
      long long int k = time - prev;
      prev = time;
      if (mn - k <= h && mx + k >= l) {
        mn = max(mn - k, l);
        mx = min(mx + k, h);
      } else {
        flag = false;
      }
    }
    if (flag) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
