#include<ctime>
#include<cstdio>
#include<cctype>
#define ll long long
using namespace std;
const ll N=2e5+7;
ll read(){
	char c;
	ll x=0,f=1;
	while(!isdigit(c=getchar()))
		f-=2*(c=='-');
	while(isdigit(c)){
		x=x*10+f*(c-48);
		c=getchar();
	}
	return x;
}
ll n,w,s,t,m,p,f,a[N];
int main(){
	#ifndef ONLINE_JUDGE
	freopen("D.in","r",stdin);
	freopen("D.out","w",stdout);
	#endif
	clock_t t1=clock();
	//--------
	n=read();
	w=read();
	for(ll i=1;i<=n;++i){
		s=read();
		t=read();
		p=read();
		a[s]+=p;
		a[t]-=p;
		if(m<t)
			m=t;
	}
	for(ll i=0;i<=m;++i)
		a[i]+=a[i-1];
	for(ll i=0;i<=m;++i){
		if(a[i]>w)
			f=1;
	}
	if(f)
		puts("No");
	else
		puts("Yes");
	//--------
	fprintf(stderr,"%0.3lfs",1.0*(clock()-t1)/CLOCKS_PER_SEC);
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
	ll N, T;
	cin >> N >> T;
	vector<ll> A(N);
	for(auto &x: A) cin >> x;
	vector<ll> q;
	for(int bit = 0; bit < (1<<(N-N/2)); ++bit){
		ll sum = 0;
		for(int i = 0; i < N-N/2; ++i){
			if(bit&(1LL<<i)) sum += A[i+N/2];
		}
		q.push_back(sum);
	}
	sort(q.begin(), q.end());
	q.push_back(1LL<<60);
	ll res = 0;
	for(int bit = 0; bit < (1<<(N/2)); ++bit){
		ll sum = 0;
		for(int i = 0; i < N/2; ++i){
			if(bit&(1LL<<i)) sum += A[i];
		}
		if(sum > T) continue;
		auto it = upper_bound(q.begin(), q.end(), T - sum) - q.begin();
		it--;
		res = max(res, sum + q[it]);
	}
	cout << res << endl;
	return 0;
}