Problem: Problem

Gaccho is enthusiastic about the popular game Zombie Hunter. In this game, there are 5 types of armor dedicated to the head, torso, arms, hips, and legs, and the player character (PC) operated by Gaccho can have up to 1 armor for each part of the body. Can be equipped.
In addition, the weight and defense power are set for each armor, and when the total weight of the armor equipped on the PC is A or more and B or less, and the total defense power is also A or more and B or less. The PC can activate the skill.

Gaccho has N pieces of armor. Find out if your PC can activate your skills by choosing the right armor to equip.

Constraints

The input satisfies the following conditions.

* 1 ≤ N ≤ 500
* 1 ≤ A ≤ B ≤ 1012
* 1 ≤ ti ≤ 5
* −1012 ≤ xi, yi ≤ 1012

Input

The input is given in the following format.


N A B
t1 x1 y1
t2 x2 y2
...
tN xN yN


All inputs are given as integers.
The first line gives you the number of armor N you own and the two integers A and B used to activate the skill.
Information on N pieces of armor is given to the N lines that continue from the second line. ti, xi, yi represent the type, weight, and defense of the i-th armor, respectively.

Armor type The ti value indicates that 1 is head armor, 2 is torso armor, 3 is arm armor, 4 is waist armor, and 5 is foot armor.

Output

Output "Yes" if the skill can be activated, and "No" if it cannot be activated on one line.

Examples

Input

7 10 11
1 1 0
1 0 1
2 2 2
3 3 5
4 1 3
5 1 3
5 5 -1


Output

Yes


Input

7 10 10
1 1 0
1 0 1
2 2 2
3 3 5
4 1 3
5 1 3
5 5 -1


Output

No

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

#define CIN_ONLY if(1)
struct cww{cww(){
    CIN_ONLY{
        ios::sync_with_stdio(false);cin.tie(0);
    }
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define DEBUG if(0)
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline bool chmin(T &l,T r)
{bool a=l>r;if(a)l=r;return a;}
template <typename T>inline bool chmax(T &l,T r)
{bool a=l<r;if(a)l=r;return a;}
template <typename T>
istream& operator>>(istream &is,vector<T> &v){
    for(auto &it:v)is>>it;
    return is;
}
typedef pair<LL,LL> P;    
int main(){
    int N;
    cin>>N;
    LL X,Y;
    cin>>X>>Y;
    vector<vector<P>> xy(5,vector<P>(1,P(0,0)));
    REP(i,N){
        int t;LL x,y;
        cin>>t>>x>>y;
        xy[t-1].pb(P(x,y));
    }
    vector<P> A,B;
    for(auto &a:xy[0])
        for(auto &b:xy[1])
            for(auto &c:xy[2])A.pb(P(a.fi+b.fi+c.fi,a.se+b.se+c.se));
    for(auto &d:xy[3])
        for(auto &e:xy[4])B.pb(P(d.fi+e.fi,d.se+e.se));
    sort(ALL(A));
    sort(ALL(B));
    reverse(ALL(B));
    
    int M=B.size();
    multiset<LL> exist;
    int bg=0,ed=0;
    for(auto &a:A){
        while(ed<M&&a.fi+B[ed].fi>=X){
            exist.insert(B[ed].se);
            ed++;
        }
        while(bg<ed&&a.fi+B[bg].fi>Y){
            auto it = exist.find(B[bg].se);
            exist.erase(it);
            bg++;
        }
        auto it = exist.lower_bound(X-a.se);
        if(it!=exist.end()&&a.se+*it<=Y){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    return 0;
}