#include <bits/stdc++.h>
using namespace std;
int q, n, m, t, a, b;
int c;
int main() {
  cin >> c;
  while (c--) {
    cin >> n >> m;
    bool ok = true;
    int curT = 0;
    int curMa = m;
    int curMi = m;
    for (int x = 0; x < n; x++) {
      cin >> t >> a >> b;
      if (!ok) continue;
      if (a >= curMa) {
        if (curMa + t - curT >= a) {
          curMa = min(curMa + t - curT, b);
          curMi = a;
        } else {
          ok = false;
        }
      } else {
        if (curMi - (t - curT) <= b) {
          curMi = max(curMi - (t - curT), a);
          curMa = min(curMa + t - curT, b);
        } else {
          ok = false;
        }
      }
      curT = t;
    }
    if (ok)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
