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

int main()
{
    int n;
    cin >> n;
    unsigned long long s, d, x[100], y[100];
    cin >> s >> d;
    for (int i = 0; i < n; ++i)
    {
        cin >> x[i] >> y[i];
    }
    int ans = 0;
    for (int i = 0; i < n; ++i)
    {
        if (x[i] < s && y[i] > d)
        {
            ans += 1;
        }
    }
    if (ans != 0)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}
#include <bits/stdc++.h>
using namespace std;

int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);

   vector<pair<int,string>>v;
   int n;
   cin>>n;
   string name;
   int length;
   for(int i=0;i<n;i++){
       cin>>name>>length;
       v.push_back({length,name});
   }
   sort(v.begin(),v.end());

   cout<<v[n-2].second<<'\n';





   return 0;
}
