#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
#define F(index,start,end) for(ll index=start;index<end;++index)
#define IA(array,size) F(index,0,size) cin >> array[index]
#define IA2(array,height,width) F(i,0,height) F(j,0,width) cin >> array[i][j]
#define PA(array,size) F(index,0,size)  { cout << array[index]; if(index!=size-1) cout << " ";} cout << endl
#define PA2(array,height,width) F(i,0,height) {F(j,0,width) cout << array[i][j]; cout << endl;}
#define P(str) cout << str << endl
constexpr int32_t MOD=1000000007;

int main(){
    ll n,m;
    cin>>n>>m;
    if(m==0){
        cout << 1 << endl;
        return 0;
    }
    ll a[m];
    IA(a,m);
    if(n==m){
        cout << 0 << endl;
        return 0;
    }
    sort(a,a+m);

    vll d;
    if(a[0]-1!=0) d.push_back(a[0]-1);
    F(i,1,m){
        if(a[i]-a[i-1]-1!=0) d.push_back(a[i]-a[i-1]-1);
    }
    if(n-a[m-1]!=0) d.push_back(n-a[m-1]);

    sort(d.begin(),d.end());
    ll sum=0;
    for(auto dd:d){
        sum+=ll(ceil(double(dd)/d[0]));
    }
    cout << sum << endl;
    return 0;
}
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1001001001
#define LINF 1001001001001001001
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LLP;

int main() {
  
  ll N, W;
  cin >> N >> W;
  vector<ll> S(N), T(N), P(N);
  rep(i,N) cin >> S[i] >> T[i] >> P[i];

  priority_queue<pair<ll, LLP>, vector<pair<ll, LLP>>, greater<pair<ll, LLP>>> wait;
  priority_queue<LLP, vector<LLP>, greater<LLP>> now;
  
  rep(i,N) {
    pair<ll, LLP> k = make_pair(S[i], make_pair(T[i], P[i]));
    wait.push(k);
  }

  ll demand = 0;
  rep(i,200000) {
    while (!wait.empty() && wait.top().first <= i) {
      LLP next = wait.top().second; wait.pop();
      now.push(next);
      demand += next.second;
    }
    while (!now.empty() && now.top().first <= i) {
      demand -= now.top().second;
      now.pop();
    }
    if (demand > W) {
      cout << "No" << endl;
      return 0;
    }
  }  

  cout << "Yes" << endl;

  return 0;
}