#include <bits/stdc++.h>
using namespace std;
struct peo {
  int ti;
  int up;
  int low;
} t[105];
int main() {
  int w;
  scanf("%d", &w);
  while (w--) {
    int n, st1;
    scanf("%d%d", &n, &st1);
    int st2 = st1;
    for (int i = 1; i <= n; i++) scanf("%d%d%d", &t[i].ti, &t[i].low, &t[i].up);
    t[0].ti = 0;
    int flag = 1;
    for (int i = 1; i <= n && flag; i++) {
      st1 += t[i].ti - t[i - 1].ti;
      st2 -= t[i].ti - t[i - 1].ti;
      if (t[i].up <= st1 && t[i].up >= st2 ||
          t[i].low <= st1 && t[i].low >= st2 ||
          (st1 <= t[i].up && st1 >= t[i].low ||
           st2 >= t[i].low && st2 <= t[i].up)) {
        if (st1 > t[i].up) st1 = t[i].up;
        if (st2 < t[i].low) st2 = t[i].low;
      } else
        flag = 0;
    }
    if (flag)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
