#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
long long t[maxn], d[maxn], u[maxn];
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
      cin >> t[i] >> d[i] >> u[i];
    }
    long long D, U;
    D = U = m;
    bool ok = 1;
    for (int i = 1; i <= n; i++) {
      U = min(U + t[i] - t[i - 1], u[i]);
      D = max(D - (t[i] - t[i - 1]), d[i]);
      if (U < d[i] || D > u[i]) ok = 0;
    }
    if (ok)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
