#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int main() {
  int q, n, m, h[105], t[105], l[105], st, h1, l1, flag;
  cin >> q;
  while (q--) {
    scanf("%d %d", &n, &m);
    st = 0, flag = 0, l1 = m, h1 = m;
    for (int i = 1; i <= n; i++) scanf("%d %d %d", &t[i], &l[i], &h[i]);
    for (int i = 1; i <= n; i++) {
      h1 = min(h[i], t[i] - st + h1);
      l1 = max(l[i], l1 - t[i] + st);
      st = t[i];
      if (l1 > h1) {
        flag = 1;
        break;
      }
    }
    if (flag)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
