#include <iostream>
#include <vector>
#include <string>
#include <stdint.h>
#include <math.h>
#include <algorithm>
#include <cmath>

#define rep(i, j) for (int i = 0; i < (j); ++i)
#define fep(i, j) for (i = 0; i < (j); ++i)
#define pb push_back
#define ll long long
#define dp vector<pair<ll, int> >
#define dn vector<vector<int> >
#define ds vector<int>

//template <class RandomAccessIterator>
  //void sort (RandomAccessIterator first, RandomAccessIterator last);

using namespace std;

int sol()
{
    int N;
    int64_t S, D, X, Y;
    cin>>N>>S>>D;
    vector<vector<int> > p;
    string ans = "No";

    rep(i, N)
    {
       vector<int> spells;
       rep(i, 1)
       {
           cin >> X >> Y; 
           spells.pb(X);
           spells.pb(Y);
       }
       p.pb(spells); 
    }
   
    
    rep(i, N)
    {
       for(unsigned int j = 0; j < p[i].size(); ++j)
       {
           if(p[i][0] < S && p[i][1] > D)
           {
               ans = "Yes";
           }
       }
    }
        
    cout << ans;
    return 0;    
}

int main()
{
   return sol();
} 
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
int n,s,d;
int main(){
	scanf("%d%d%d",&n,&s,&d);
	bool flag=false;
	for(int i=1;i<=n;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		if(x<s&&y>d)	flag=true;
	}	
	if(flag)	puts("Yes");
	else	puts("No");
	return 0;
}