#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long i, n, l, r, m, c, s = 0, t1, a, b, c1 = 0, k4 = 0, c2 = 0, j, k, k1,
                              k2, k3;
  char ch;
  string s1;
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> t1;
  while (t1--) {
    c = 0;
    cin >> n >> m;
    long long a[1010], b[1010], t[1010];
    for (long long i = 0; i < n; i++) cin >> t[i] >> a[i] >> b[i];
    l = m - t[0];
    r = m + t[0];
    if (r < a[0] || l > b[0])
      c = 0;
    else
      c = 1;
    if (c == 1) {
      l = max(l, a[0]);
      r = min(r, b[0]);
      for (long long i = 1; i < n; i++) {
        l -= (t[i] - t[i - 1]);
        r += (t[i] - t[i - 1]);
        if (r < a[i] || l > b[i])
          break;
        else {
          c++;
          l = max(l, a[i]);
          r = min(r, b[i]);
        }
      }
    }
    if (c == n)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
