// *** Though I am not John Snow, yet I know nothing ***
#include <bits/stdc++.h>
using namespace std;
#define F(i, a, b) for (int i = a; i < b; i++)
#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int, int>
#define vi vector<int>
#define mii map<int, int>
#define pqb priority_queue<int>
#define pqs priority_queue<int, vi, greater<int>>
#define setbits(x) __builtin_popcountll(x)
#define mod 1000000007
#define inf 1e18
#define ps(x, y) fixed << setprecision(y) << x
#define mk(arr, n, type) type *arr = new type[n];
#define range(a, b) substr(a, b - a + 1)
#define w(x)  \
    int x;    \
    cin >> x; \
    while (x--)
#define trace(x) cerr << #x << ": " << x << " " << endl;
#define FIO                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)

void solve()
{
    int n;
    cin >> n;
    int a[105];
    int t, p;
    cin >> t >> p;
    F(i, 0, n)
    {
        int st, pt;
        cin >> st >> pt;
        if (st < t && pt > p)
        {
            cout << "Yes";
            return;
        }
    }
    cout << "No";
}

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    FIO;

    solve();

    return 0;
}
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <cstring>
#include <bitset>
#include <array>

using namespace std;



int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n, m;
	cin >> n >> m;
	if(abs(m)>max(n-2, 0)){
		cout << -1 << '\n';
		return 0;
	}
	if(m<0){
		cout << -1 << '\n';
		return 0;
		m=abs(m)+1;
		cout << 1 << ' ' << m+2 << '\n';
		int pos=(m+1)*2;
		for(int i=0; i<m; i++){
			cout << i+2 << ' ' << pos << '\n';
			pos--;
		}
		pos=(m+1)*2+1;
		for(int i=0; i<n-m-1; i++){
			cout << pos << ' ' << pos+1 << '\n';
			pos+=2;
		}
	}
	else if(m>0){
		int pos=1;
		m++;
		for(int i=0; i<n-m-1; i++){
			cout << pos << ' ' << pos+1 << '\n';
			pos+=2;
		}
		cout << pos << ' ' << pos+(m+1)*2-1 << '\n';
		for(int i=0; i<m; i++){
			cout << pos+i*2+1 << ' ' << pos+(i+1)*2 << '\n';
		}
	}
	else{
		int pos=1;
		for(int i=0; i<n; i++){
			cout << pos << ' ' << pos+1 << '\n';
			pos+=2;
		}
	}
	
	return 0;
}
