#include <bits/stdc++.h>
using namespace std;
double const EPS = 1e-12, PI = acos(-1);
const int N = 1e6 + 9, M = 1e5 + 9, OO = 1e9 + 7, MOD = 1e9 + 7;
const long long inf = 1e18;
long long t[N], l[N], h[N];
long long dp1[N], dp2[N];
int main() {
  cout << fixed << setprecision(12), ios::sync_with_stdio(false),
      cin.tie(nullptr), cout.tie(nullptr);
  int q;
  cin >> q;
  while (q--) {
    long long n, temp;
    cin >> n >> temp;
    for (int i = 0; i < n; ++i) cin >> t[i] >> l[i] >> h[i];
    long long prv = 0, low = temp, high = temp;
    bool can = 1;
    for (int i = 0; i < n; ++i) {
      low -= (t[i] - prv);
      high += (t[i] - prv);
      low = max(low, l[i]);
      high = min(high, h[i]);
      if (low > high) {
        can = 0;
        break;
      }
      prv = t[i];
    }
    if (can)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
