#include <bits/stdc++.h>
using namespace std;
pair<long long, int> b[1000000 + 10];
const int maxn = 200, maxm = 100;
char s[maxn][maxm];
bool vis[maxn];
int lena, lenb;
int split_at;
bool cmp(int &a, int &b) { return a > b; }
struct customer {
  long long t, low, high;
};
vector<customer> a;
string doit() {
  long long n, m;
  cin >> n >> m;
  a.resize(n);
  for (int i = 0; i < n; i++) {
    scanf("%lld%lld%lld", &a[i].t, &a[i].low, &a[i].high);
  }
  long long capmin = m, capmax = m, capt = 0;
  for (int i = 0; i < n;) {
    long long curmin = a[i].low;
    long long curmax = a[i].high;
    int j = i + 1;
    while (j < n && a[i].t == a[j].t) {
      curmin = max(curmin, a[j].low);
      curmax = min(curmax, a[j].high);
      j++;
    }
    if (curmin > curmax) {
      return "NO";
    }
    capmin = capmin - (a[i].t - capt);
    capmax = capmax + (a[i].t - capt);
    if (curmin > capmax || curmax < capmin) {
      return "NO";
    } else {
      capmax = min(capmax, curmax);
      capmin = max(capmin, curmin);
    }
    if (capmin > capmax) {
      return "NO";
    }
    capt = a[i].t;
    i = j;
  }
  return "YES";
}
int main() {
  int n, m, t;
  deque<char> ans;
  cin >> t;
  while (t--) {
    cout << doit() << endl;
  }
}
