#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long int n, m, check = 1, temp = 0;
    cin >> n >> m;
    long long int low = m, high = m;
    for (long long int i = 1; i <= n; ++i) {
      long long int x, y, z;
      cin >> x >> y >> z;
      low = low - x + temp;
      high = high + x - temp;
      temp = x;
      if (low > z || high < y) check = 0;
      low = max(low, y);
      high = min(high, z);
    }
    if (check == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
