#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 1e9 + 7;
const int INF = 0x3f3f3f3f;
struct node {
  long long t, l, r;
} s[110];
int main() {
  ios::sync_with_stdio(0);
  int q;
  cin >> q;
  while (q--) {
    int n, m;
    cin >> n >> m;
    bool flag = 0;
    long long minx = m, maxn = m;
    s[0].t = 0;
    for (int i = 1; i <= n; i++) {
      cin >> s[i].t >> s[i].l >> s[i].r;
      long long time = s[i].t - s[i - 1].t;
      if ((minx - time) > s[i].r || (maxn + time) < s[i].l) flag = 1;
      minx = max(minx - time, s[i].l);
      maxn = min(maxn + time, s[i].r);
    }
    if (flag)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
