#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
#define totori signed
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
ll dx[4]={0,1,-1,0};
ll dy[4]={1,0,0,-1};

template< int mod = 1000000007 >
struct ModInt {
    int x;
    ModInt() : x(0) {}
    ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
    ModInt &operator+=(const ModInt &p) {
        if((x += p.x) >= mod) x -= mod;
        return *this;
    }
    ModInt &operator-=(const ModInt &p) {
        if((x += mod - p.x) >= mod) x -= mod;
        return *this;
    }
    ModInt &operator*=(const ModInt &p) {
        x = (int) (1LL * x * p.x % mod);
        return *this;
    }
    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }

    ModInt operator-() const { return ModInt(-x); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const {
        int a = x, b = mod, u = 1, v = 0, t;
        while(b > 0) {
            t = a / b;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return ModInt(u);
    }

    ModInt pow(int64_t n) const {
        ModInt ret(1), mul(x);
        while(n > 0) {
            if(n & 1) ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }

    friend ostream &operator<<(ostream &os, const ModInt &p) {
        return os << p.x;
    }

    friend istream &operator>>(istream &is, ModInt &a) {
        int64_t t;
        is >> t;
        a = ModInt< mod >(t);
        return (is);
    }

    static int get_mod() { return mod; }
};

const int mod = 1000000007;
// const int mod = 998244353;
using mint = ModInt< mod >;

totori main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);


    int q;
    cin>>q;
    while(q--){
        ll n,a,b;
        cin>>n>>a>>b;
        if(a+b<=n){
            if(a<b)swap(a,b);
            mint ans = (n-a+1)*(n-a+1);
            ans *= (n-b+1)*(n-b+1);
            // kanzen ni naka
            mint sub = (a-b+1)*(a-b+1);
            sub *= (n-a+1)*(n-a+1);
            ans -= sub;

            // katahou dake naka
            mint ret = (n-a+1)*(a-b+1);
            mint sum = (n-a+1-1)*(n-a+1)/2;
            sum -=(n-a-b+1)*(n-a-b+2)/2;
            ret *= sum;
            ans -= ret*4;

            // ryouhou naka
            ret = 0;
            n -= a;
            n++;
            ret = (b-1)*(b-1);
            ret *= (b-2*n) * (b-2*n);
            ans -= ret;
            cout << ans << "\n";
        }
        else cout << 0 << "\n";
    }
}
#include <bits/stdc++.h>
using namespace std;
int N, W, S, T;
long long P, A[200001];
void SET(int S, int T, long long P) {
  A[S] += P;
  A[T] -= P;
}
void GET(int W) {
  long long foo = 0;
  for (int i = 0; i <= 2e5; i++) {
    foo += A[i];
    if (foo > W) {
      cout << "No";
      exit(EXIT_SUCCESS);
    }
  }
  cout << "Yes";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 0; i <= 200000; i++) {
    A[i] = 0;
  }
  cin >> N >> W;
  for (int i = 0; i < N; i++) {
    cin >> S >> T >> P;
    SET(S, T, P);
  }
  GET(W);
  return 0;
}