#include <bits/stdc++.h>
using namespace std;
long long T, n, tempur;
int t[105], l[105], h[105];
int main() {
  cin >> T;
  while (T--) {
    memset(t, 0, sizeof t);
    memset(h, 0, sizeof h);
    memset(l, 0, sizeof l);
    cin >> n >> tempur;
    int maxn = tempur, minn = tempur;
    for (int i = 1; i <= n; i++) {
      cin >> t[i] >> l[i] >> h[i];
    }
    int f = 0;
    for (int i = 1; i <= n; i++) {
      maxn += t[i] - t[i - 1];
      minn -= t[i] - t[i - 1];
      if ((h[i] >= minn && l[i] <= maxn) || (h[i] <= maxn && l[i] >= minn)) {
        maxn = min(maxn, h[i]);
        minn = max(minn, l[i]);
      } else {
        f = 1;
        break;
      }
    }
    if (!f)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
