#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
using ll = long long;
using P = pair<int, int>;
const ll INF = 1LL << 60;
const int MAX = 200001;

int main() {
  ll n, w;
  cin >> n >> w;
  
  bool flag = false;
  
  vector<ll> a(MAX, 0);
  rep(i, n){
    ll s, t, p;
    cin >> s >> t >> p;
    a[s] += p;
    a[t] -= p;
  }
  rep(i, MAX){
    a[i+1] += a[i];
    if(a[i] > w) flag = true;
  }
  
  if(flag) cout << "No" << endl;
  else cout << "Yes" << endl;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll b,c;
	scanf("%lld%lld",&b,&c);
	ll cnt=0;
	if(b<=0){
		cnt=c+1;
		c--;
		if(b==0)cnt--;
		if(c>0&&b<0)cnt+=min(-2*b-1,c-1);
	}else {
		cnt=c+(c==1?1:0);
		cnt+=min(2*b-1,c-1);
	}printf("%lld\n",cnt);
}