#include <bits/stdc++.h>
using namespace std;
int z, x, n, m, w, h, cas, a[1000], b[1000], c[1000];
int main() {
  scanf("%d", &cas);
  while (cas--) {
    scanf("%d%d", &z, &x);
    for (int i = 1; i <= z; i++) scanf("%d%d%d", &a[i], &b[i], &c[i]);
    n = x;
    m = x;
    w = 0;
    for (int i = 1; i <= z; i++) {
      n = n - (a[i] - w);
      m = m + (a[i] - w);
      if (b[i] > n) n = b[i];
      if (c[i] < m) m = c[i];
      if (n > m) break;
      w = a[i];
    }
    if (n > m)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
