#include <bits/stdc++.h>   using namespace std;   int II() {     int q;     scanf( %d , &q);     return q;   }   void solve() {     long long N, M;     cin >> N >> M;     long long ar[N + 10], br[N + 10], cr[N + 10];     for (long long i = 1; i <= N; i++) {       cin >> ar[i] >> br[i] >> cr[i];     }     long long mi = M, mx = M;     ar[0] = 0;     for (long long i = 1; i <= N; i++) {       long long q = ar[i] - ar[i - 1];       mi = max(mi - q, br[i]);       mx = min(mx + q, cr[i]);       if (mi > cr[i] or mx < br[i]) {         cout <<  NO  << endl;         return;       }     }     cout <<  YES  << endl;   }   int32_t main() {     long long tt;     cin >> tt;     long long cas = 1;     while (tt--) {       solve();     }   }   