#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n, m;
    int last, L, R;
    scanf("%d%d", &n, &m);
    bool valid = true;
    last = 0, L = R = m;
    for (int i = 1; i <= n; ++i) {
      int t, l, h;
      scanf("%d%d%d", &t, &l, &h);
      if (valid) {
        R += t - last;
        L -= t - last;
        R = min(R, h);
        L = max(L, l);
        last = t;
        if (R < L) valid = false;
      }
    }
    puts(valid ? "YES" : "NO");
  }
  return 0;
}
