//This Code is written by Anubhav Srivastava(anubhavsrivastavawebpage.wordpress.com)

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
//Defines
#define pb push_back
#define f(i,n) for(ll i=0;i<n;i++)
#define fl(i,a,b) for(ll i=a;i<b;i++)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define vec(x) vector<x>
#define mp make_pair
#define popc(x) __builtin_popcountll(x)
#define iter(it, s) for(auto it = s.begin(); it != s.end(); it++)
#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define pair(x,y) pair<ll x,ll y>
#define deb(x) cout << #x << "=" << x << "\n"
#define PI 3.1415926535897932384626
const int mod = 1000000007;

//Important Functions
//Main Function
int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,v1,t,k,m,q;
    cin >>  n >> k;
    vec(ll) v(200005,0);
    int flag=0;
    f(i,n){
        cin >> t >> m >> q;
        v[t]+= q;
        v[m]-=q;
    }
    ll sum=0;
    f(i,n){
        sum+=v[i];
        if(sum>k) {
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";
    
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define fast ios::sync_with_stdio(false); cin.tie(0)
#define foru(i, k, n) for (ll i = k; i < n; i++)
#define ford(i, k, n) for (ll i = k; i >= n; i--)
#define pb push_back
#define ff first
#define ss second

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <list>
#include <queue>
#include <bitset>
#include <map>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef pair<ll, ll> pll;

const ll mod = 998244353;

void imult(ll& lhs, const ll& rhs) {
	lhs = ((lhs % mod) * (rhs % mod)) % mod;
}

void iadd(ll& lhs, const ll& rhs) {
	lhs = ((lhs%mod) + (rhs%mod)) % mod;
}

void isubt(ll& lhs, const ll& rhs) {
	ll ret = (lhs - rhs) % mod;
	lhs = ret + (ret < 0 ? mod : 0);
}

ll bpw(const ll& lhs, const ll& rhs) {
	if (rhs == 0)return 1;
	ll ret = bpw(lhs, rhs >> 1);
	imult(ret, ret);
	if (rhs & 1) imult(ret, lhs);
	return ret;
}

ll inv(const ll& x) {
	return bpw(x, mod - 2);
}

ll mult(const ll& lhs, const ll& rhs) {
	return ((lhs % mod) * (rhs % mod)) % mod;
}

ll add(const ll& lhs, const ll& rhs) {
	return ((lhs%mod) + (rhs%mod)) % mod;
}

ll subt(const ll& lhs, const ll& rhs) {
	ll ret = (lhs - rhs) % mod;
	return ret + (ret < 0 ? mod : 0);
}

ll div(const ll& lhs, const ll& rhs) {
	return mult(lhs, inv(rhs));
}

const int sz = 5005, LOG = 13;
int n, m;
ll dp[LOG+1][sz];
ll chs[sz][sz];

void initchs() {
	foru(i, 0, sz)chs[i][0] = 1;
	foru(i, 1, sz) {
		foru(j, 0, i + 1) {
			if (!j)chs[i][j] = 1;
			else chs[i][j] = add(chs[i - 1][j], chs[i - 1][j - 1]);
		}
	}
}

int main() {
	fast;
	cin >> n >> m;
	initchs();
	ford(bit, LOG - 1, 0) {
		ll msk = (1 << bit);
		foru(sum, 0, m + 1) {
			for (int i = 0; 2 * i <= n && sum > 2 * i * msk; i++) {
				iadd(dp[bit][sum], mult(dp[bit + 1][sum - 2 * i * msk], chs[n][2 * i]));
			}
			if (sum % (2 * msk) == 0)
				iadd(dp[bit][sum], chs[n][sum / msk]);
		}
	}
	cout << dp[0][m] << '\n';
	return 0;
}