#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n, m;
    cin >> n >> m;
    int t[102], lo[102], h[102];
    t[0] = 0;
    lo[0] = h[0] = m;
    bool flag = true;
    for (int i = 1; i <= n; i++) {
      cin >> t[i] >> lo[i] >> h[i];
      if (flag) {
        int d = lo[i - 1] - (t[i] - t[i - 1]);
        int u = h[i - 1] + (t[i] - t[i - 1]);
        if (d > h[i] || u < lo[i]) {
          cout << "NO" << endl;
          flag = false;
        }
        h[i] = min(u, h[i]);
        lo[i] = max(d, lo[i]);
      }
    }
    if (flag) cout << "YES" << endl;
  }
  return 0;
}
