        // Rakib (CSE'19)
                 
        #include<bits/stdc++.h>
                 
        #define               boost_                 ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
        #define               pb                     push_back
        #define               read(i,n,a)            for(i=0;i<n;++i) cin>>a[i]
        #define               print(i,a)             for(auto i:a) cout<<i<< " " ; cout<<endl ;
        #define               dpoint(n)              cout<<showpoint<<fixed<<setprecision(n)
        #define               MOD                    1000003
        #define               llmax                  LONG_LONG_MAX
        #define               llmin                  LONG_LONG_MIN
        #define               read_grid(i,j,n,m,a)   for(i=0;i<n;++i) for(j=0;j<m;++j) cin >> a[i][j];
        #define               all(a)                 a.begin(),a.end()
        #define               vl                     vector<ll>
                 
        typedef               long long              ll;
        typedef               unsigned long long     ull;
                 
         using namespace std;
     
        int gcd(int x,int y){
                if(!y) return x;
                return gcd(y,x%y);
        }
        ll MX=100001;
         
        vector<ll>check(MX,1), divisor(MX,2);
         //vector<ll>primes,divisor;
                 
        void prime(){
                 
                ll i,j;                                                         
                //check[1]=0;
                //check[2]=1;
                //primes.pb(2);
                for(i=3;i<MX;i+=2){
                        if(check[i]){
                                //primes.pb(i);
                                divisor[i]=i;
                                for(j=i*i;j<MX;j+=2*i) divisor[j]=i, check[j]=0; 
                        }
                }
        }
                 
        void task(ll case_no){
                
            ll n,m;
            cin >> n >> m;
            ll i,j;
            ll a[n][m];
        
            ll x=llmax;
            for(i=0;i<n;++i){
                    for(j=0;j<m;++j){
                            cin >> a[i][j];
                            x=min(x,a[i][j]);
                    }
            }

            ll ans=0;

            for(i=0;i<n;++i){
                    for(j=0;j<m;++j){
                            ans+=a[i][j]-x;
                    }
            }

            cout << ans << "\n";

        }

                 
        int main(){
                        
                boost_;
                //prime();
                ll t=1,i=0;
                //cin >> t;
     
                while(t--){
     
                        task(++i);
                                
                }
                 
                return 0;
        }
                
#include <bits/stdc++.h>
using namespace std;

#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
//#define ld long double
#define mod  998244353
//define inf 100000000000010
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
//#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define rep(x,j,n)for(int x=j;x<n;x++)
#define repr(x,n,j)for(ll x=n;x>j;x--)
#define all(x) (x).begin(), (x).end()

typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll,ll> pi;
typedef long double ld;

mt19937 myrand(time(0));

bool isprime(ll n)
{
    if(n<=1)return false;
    if(n<=3)return true;
    if(n%2==0||n%3==0)return false;
    for(ll i=5;i*i<=n;i+=6)
    {
        if(n%i==0||n%(i+2)==0)return false;
    }
    return true;
}

ll modexp(ll a,ll b,ll m)
{
    ll r=1;
    a=a%m;
    while(b>0)
    {
        if(b&1)r=(r*a)%m;
        b = b>>1;
        a=(a*a)%m;
    }
    return r%m;
}




ll builtin_popcount(ll x)
{
    ll cnt = 0;
    for(ll i=60;i>=0;i--)
    {
        if((1LL<<i)&x)cnt++;
    }
    return cnt;
}

ll addmod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    return (a+b)%mod;
}
ll mulmod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    return (a*b)%mod;
}
ll submod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    a-=b;
    if(a<0)a+=mod;
    return a%mod;
}


struct CustomCompare
{
    bool operator()(pi a,pi b)
    {
        return a.fi<b.fi;
    }
};
/*
const int mxn = 5*(1e6) +10;
vi spf(mxn);
void sieve()
{
    for(ll i =0;i<mxn;i++)spf[i]  = i;
    for(ll i=2;i<mxn;i+=2)spf[i] = 2;
    for(ll i = 3;i*i<mxn;i++)
    {
        if(spf[i]==i)
        {
            for(ll j = i*i;j<mxn;j+=i)
            {
                if(spf[j]==j)spf[j] = i;
            }
        }
    }
}
*/

const int mxn = 2e5 +10;

vi arr(mxn);
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);

ll n,w; cin>>n>>w;

rep(i,0,n)
{
    ll l,r,p; cin>>l>>r>>p;
    arr[l]+=p;
    arr[r]-=p;
}

bool flag = true;
ll curr = 0;
rep(i,0,mxn)
{
    curr+=arr[i];
    if(curr>w)flag = false;
}
if(flag)cout<<"Yes\n";
else cout<<"No\n";
return 0;
}
/*


*/
