#include <bits/stdc++.h>
using namespace std;
struct Customer {
  int time;
  long int low, high;
};
int air_conditioning_possible(Customer customers[], int n, long int m, int i);
int main() {
  int t;
  cin >> t;
  int testcase_result[t];
  for (int i = 0; i < t; i++) {
    int n;
    long int m;
    cin >> n >> m;
    Customer customers[n];
    for (int j = 0; j < n; j++)
      cin >> customers[j].time >> customers[j].low >> customers[j].high;
    testcase_result[i] = air_conditioning_possible(customers, n, m, i);
  }
  for (int i = 0; i < t; i++) {
    if (testcase_result[i] == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
int air_conditioning_possible(Customer customers[], int n, long int m,
                              int test) {
  long int time, h1, l1, h2, l2;
  for (int i = n - 2; i >= 0; i--) {
    long int arr[n][3];
    for (int j = 0; j < n; j++) {
      arr[j][0] = customers[j].time;
      arr[j][1] = customers[j].low;
      arr[j][2] = customers[j].high;
    }
    time = customers[i].time;
    h1 = customers[i].high;
    l1 = customers[i].low;
    h2 = customers[i + 1].high + (customers[i + 1].time - time);
    l2 = customers[i + 1].low - (customers[i + 1].time - time);
    if (h1 < l2 || l1 > h2)
      return 0;
    else if (h1 <= h2 && l1 >= l2) {
      customers[i].high = h1;
      customers[i].low = l1;
    } else if (h1 >= h2 && l1 <= l2) {
      customers[i].high = h2;
      customers[i].low = l2;
    } else if (h1 < h2 && (l2 <= h1 && l2 >= l1)) {
      customers[i].high = h1;
      customers[i].low = l2;
    } else if ((h2 <= h1 && h2 >= l1) && l1 > l2) {
      customers[i].high = h2;
      customers[i].low = l1;
    } else {
      cout << "h1 = " << h1 << " l1 = " << l1 << " h2 = " << h2
           << " l2 = " << l2 << endl;
      for (int j = 0; j < n; j++)
        cout << arr[j][0] << " " << arr[j][1] << " " << arr[j][2] << endl;
    }
  }
  int h = customers[0].high + customers[0].time,
      l = customers[0].low - customers[0].time;
  if (m <= h && m >= l)
    return 1;
  else
    return 0;
}
