#include <bits/stdc++.h>
using namespace std;
struct node {
  int di;
  long xia, shang;
};
node aa[101];
int main() {
  int t;
  cin >> t;
  while (t > 0) {
    int n;
    long m, mm;
    cin >> n >> m;
    mm = m;
    for (int i = 0; i < n; i++) {
      cin >> aa[i].di >> aa[i].xia >> aa[i].shang;
    }
    long shijian = 0;
    bool asd = true;
    for (int i = 0; i < n; i++) {
      long cha = aa[i].di - shijian;
      m = m - cha;
      mm = mm + cha;
      shijian = aa[i].di;
      if (aa[i].xia > mm || aa[i].shang < m) {
        asd = false;
        break;
      } else {
        m = max(m, aa[i].xia);
        mm = min(mm, aa[i].shang);
      }
    }
    if (asd)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    t--;
  }
}
