#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int>A(2*N);
    vector<pair<int,int>>B(2*N);
    vector<int>C(2*N);
    for(int i = 0; i < 2*N; i++) {
        cin >> A[i];
        B[i] = {A[i],i};
    }
    sort(B.rbegin(),B.rend());
    for(int i = 0; i < N; i++) {
        C[B[i].second]++;
    }
    string ans = "";
    int sum1 = 0,sum2 = 0;
    for(int i = 0; i < 2*N; i++) {
        if(C[i] == 0) {
            if(sum2) {
                sum2--;
                ans += ')';
            }
            else {
                sum1++;
                ans += '(';
            }
        }
        else {
            if(sum1) {
                sum1--;
                ans += ')';
            }
            else {
                sum2++;
                ans += '(';
            }
        }
    }
    cout << ans << endl;
}

#pragma region RegionDefs
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,l,r) for(int i=(l),i##_len=(r);i<i##_len;++i)
#define repr(i,l,r) for(int i=(r)-1,i##_left=(l);i>=i##_left;--i)
#define all(x) begin(x),end(x)
using namespace std;
typedef long long ll;
const ll INF = 1e9;
template<class T=ll> using V = vector<T>;
template<class T=ll> using PQ = priority_queue<T>;
template<class T=ll> using PQG = priority_queue<T, V<T>, greater<T>>;
const ll MOD = 1000000007LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail) { cin >> head; in(move(tail)...); }
#define IN(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define TIN(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
#define VIND(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem,--_elem
#define OUT(x) cout << (x);
#define OUTL(x) cout << (x) << endl;
template<class T>bool chmax(T &a, const T &b) {if (a<b) {a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if (a>b) {a=b; return 1;} return 0;}
template<class T>
string join(vector<T>& v, string delim="") { ostringstream os; rep(i,v.size())i?os<<delim<<v[i]:os<<v[0]; return os.str(); }
#pragma endregion RegionDefs

ll acc[214514];

void solve()
{
    IN(n, w);
    rep(i, n) {
        IN(s, t, p);
        acc[s] += p;
        acc[t] -= p;
    }
    ll tmp = 0;
    rep(i, 214514) {
        tmp += acc[i];
        if (tmp > w) {
            OUTL("No");
            return;
        }
    }
    OUTL("Yes");
}

int main()
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(numeric_limits<double>::max_digits10);

    solve();

    return 0;
}