#include <bits/stdc++.h>


#define vi vector<int>
#define tests int t; cin>>t; while(t--)
#define ll long long
#define vll vector<long long>
#define srt(v) sort(v.begin(), v.end())
#define srtg(v) sort(v.begin(), v.end(), greater<int> ())
#define FOR(k, n) for(int k=0; k<n; k++)
#define pb push_back
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define printarr(v) for(auto& x : v) cout<<x<<" "; cout<<endl

using namespace std;


char nums[10] = { '0','1','2','3','4','5','6','7','8','9' };
char alphsl[26] = { 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' };
const int MOD = 1000000007;
char alphs[26] = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };



void solve() {
    
   int n, w;
   cin>>n>>w;
   
   vi start(n), end(n), litre(n);
   for(int i=0; i<n; i++){
       cin>>start[i]>>end[i]>>litre[i];
   }
   
   vi open[200005], close[200005];
   
   for(int i=0; i<n; i++){
       int currop=start[i];
       open[currop].pb(i);
       currop=end[i];
       close[currop].pb(i);
   }
   ll curr=0;
   for(int i=0; i<=200000; i++){
       for(auto x : open[i]) curr+=litre[x];
       for(auto y : close[i]) curr-=litre[y];
       
       if(curr>w){
           cout<<"No"<<endl;
           return;
       }
       
   }
   cout<<"Yes"<<endl;
   
}


int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
   
    
        
        solve();


    return 0;
}







#include <iostream>
#include<algorithm>
using namespace std;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);
    int N,S,T;long W,P;
    int maxx = 0;
    long long a[200010]={0},sum=0,sum1=0;

    cin >> N >> W;
    for(int i=1;i<=N;i++){
        cin >> S >> T >> P;
        maxx = max(maxx,T);
        a[S] += P;
        a[T] -= P;
    }
    for(int i=0;i<maxx;i++){
        sum1 = max(sum,sum + a[i]);
        sum += a[i];
        if(sum>W){
            cout << "No" << endl;
            //cout << sum1<<endl;
            //cout << a[0]<<endl;
            //cout << a[200000]<<endl;
            return 0;
        }
    }
    cout << "Yes";
    //cout << sum1;
    return 0;
}
