#include <bits/stdc++.h>
using namespace std;
struct customer {
  long long time;
  long long low;
  long long high;
};
void testcase() {
  long long n, m;
  cin >> n >> m;
  customer c[n];
  for (int i = 0; i < n; i++) {
    cin >> c[i].time >> c[i].low >> c[i].high;
  }
  long long leftrange;
  long long rightrange;
  long long time = c[0].time;
  leftrange = m - c[0].time;
  rightrange = m + c[0].time;
  for (int i = 0; i < n - 1; i++) {
    if (c[i].low > rightrange || c[i].high < leftrange) {
      cout << "NO\n";
      return;
    }
    long long h = min(rightrange, c[i].high);
    long long l = max(leftrange, c[i].low);
    rightrange = h + c[i + 1].time - c[i].time;
    leftrange = l - (c[i + 1].time - c[i].time);
  }
  if (c[n - 1].low > rightrange || c[n - 1].high < leftrange) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    testcase();
  }
  return 0;
}
