
#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
#include <unordered_map>
#include <climits>
#include <algorithm>
#include <map>
#include <queue>
#include <random>
#include <chrono>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef map<int, int> mii;
typedef unordered_map<int, int> umii;
typedef map<ll, ll> mll;
typedef unordered_map<ll, ll> umll;
 
 
#define randoom mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
//use rng() for random
 
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define cntbit(x) __builtin_popcount(x)
#define cntBitll(x) __builtin_popcountll(x)
 

#define forn(i, n) for(int i = 0; i < int(n); i++)
#define rep(i,n) for (int i=1;i <=int(n);i++)
pii a[200001];

int main(){
    int n,w; cin >> n >> w;
    vector<pair<pii,int>> events;
    rep(i,n){
        int ppp;
        cin >> a[i].fi >> a[i].se >> ppp;
        events.pb(mp(mp(a[i].fi,1),ppp));events.pb(mp(mp(a[i].se,-1),ppp));
        
    }
    sort(all(events));
    int pp=0;
    for (auto p:events){
        pp+=p.fi.se*p.se;
        if (pp>w) {
            cout << "No"; return 0;
        }
    }
    cout << "Yes";
    
    

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define all(x) x.begin(),x.end()
typedef long long ll;
ll mod = 1000000007;
ll inf = 1e18;
int main(){

    int n,m;
    cin >> n >> m;
    vector<int> a(m);
    rep(i,m) cin >> a[i];
    sort(all(a));

    if(m==0){
        cout << 1 << endl;
        return 0;
    }

    int h=mod;
    rep(i,m){
        if(i!=0){
            if(a[i]-a[i-1]-1!=0) h=min(h,a[i]-a[i-1]-1);
        }
    }
    if(a[0]-1!=0) h=min(h,a[0]-1);
    if(n-a[m-1]!=0) h=min(h,n-a[m-1]);

    ll count=0;
    rep(i,m){
        if(i!=0){
            if(a[i]-a[i-1]-1!=0) count+=(a[i]-a[i-1]-2)/h+1;
        }
    }    
    if(a[0]-1!=0) count+=(a[0]-1-1)/h+1;
    // cout << count << endl;
    if(n-a[m-1]!=0) count+=(n-a[m-1]-1)/h+1;

    cout << count << endl;
    // cout << h << endl;

    return 0;
}