#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int q;
  cin >> q;
  while (q--) {
    long long n, m;
    cin >> n >> m;
    long long t[n], l[n], h[n];
    for (long long i = 0; i < n; i++) {
      cin >> t[i] >> l[i] >> h[i];
    }
    if (t[0] >= l[0] - m && t[0] >= m - h[0]) {
      int ck = 0;
      for (long long i = 1; i < n; i++) {
        if (t[i] >= l[i] - m && t[i] >= m - h[i]) {
          for (long long j = 0; j < i; j++) {
            if (t[i] - t[j] >= l[i] - h[j] && t[i] - t[j] >= l[j] - h[i]) {
              continue;
            } else {
              ck = 1;
              cout << "NO" << endl;
              break;
            }
          }
        } else {
          ck = 1;
          cout << "NO" << endl;
          break;
        }
        if (ck == 1) break;
      }
      if (ck == 0) {
        cout << "YES" << endl;
      }
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
