#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, m, mark = 0;
    cin >> n >> m;
    long long t2 = 0, l1, r1;
    l1 = m;
    r1 = m;
    while (n--) {
      long long t1, l, r, t3;
      cin >> t1 >> l >> r;
      t3 = t1 - t2;
      t2 = t1;
      if (l1 <= l && r1 >= r) {
        l1 = l;
        r1 = r;
      } else if (l1 >= l && l1 <= r) {
        if (r1 >= l && r1 <= r) {
          l1 = max(l, (l1 - t3));
          r1 = min(r, (r1 + t3));
        } else {
          l1 = max(l, (l1 - t3));
          r1 = r;
        }
      } else if (r1 >= l && r1 <= r) {
        if (l1 >= l && l1 <= r) {
          l1 = max(l, (l1 - t3));
          r1 = min(r, (r1 + t3));
        } else {
          l1 = l;
          r1 = min(r, (r1 + t3));
        }
      } else if (l < l1 && r >= (l1 - t3)) {
        l1 = max(l, (l1 - t3));
        r1 = max(r, (l1 - t3));
      } else if (r > r1 && l <= (r1 + t3)) {
        l1 = min(l, (r1 + t3));
        r1 = min(r, (r1 + t3));
      } else {
        mark = 1;
      }
    }
    if (mark == 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
