#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int flag = 0;
    long long n, m, nowl = 0, nowr = 0, now_t = 0;
    scanf("%lld%lld", &n, &m);
    nowl = m, nowr = m;
    for (int i = 0; i < n; i++) {
      long long time, l, h, tt;
      scanf("%lld%lld%lld", &time, &l, &h);
      tt = time - now_t;
      nowl -= tt, nowr += tt;
      if (nowl > h || nowr < l) flag = 1;
      nowl = max(l, nowl), nowr = min(nowr, h);
      now_t = time;
    }
    if (flag)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
