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

int main() {
  ll n, s, d;
  cin >> n >> s >> d;
  
  using pll = pair<ll, ll>;
  vector<pll> xy(n);
  for (int i = 0; i < n; i++) {
    cin >> xy.at(i).first >> xy.at(i).second;
  }
  
  bool judge = false;
  for (int i = 0; i < n; i++) {
    if (xy.at(i).first < s && xy.at(i).second > d) {
      judge = true;
      break;
    }
  }
  
  if (judge) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
int main() {
	int n;int mn=INT_MAX; 
	cin>>n;
	for (int i=0;i<n;i++){
		int a,p,x;
		cin>>a>>p>>x;
		//cout<<x<<" "<<a<<"\n";
		if (x-a>0)mn=min(p,mn);
	}
	if (mn!=INT_MAX)cout<<mn<<"\n";
	else cout<<"-1\n";
	return 0;
}