#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define Rep(i,j,n) for(int i = j; i < (int)(n); i++)
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main(){
    int n;
    cin >> n;
    map<int, string> m;
    rep(i,n){
        string s;
        int t;
        cin >> s >> t;
        m[t] = s; 
    }
    int num = 1, cnt = 0;
    for (auto i = m.rbegin(); i != m.rend(); ++i) {
        if(cnt == num) {
            cout << i->second << endl;
            return 0;
        }
        cnt++;
    }

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(a) (a.begin(),a.end())
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = s; i < (int)(n); ++i)
#define ret return

//cout << fixed << setprecision(15)
//ASCIIコード 0==48　A==65 Z==90, a==97 z==122

int main(){
  string N; cin>>N;  
  ll cnt=0;
  reverse all(N);
  rep(i,N.size()){
     if(N[i]=='0')  cnt++;
    else break;
  }
 rep(i,cnt){
    N.push_back('0');
 }
 string S=N; reverse all(N);
  if(S==N){cout <<"Yes"<<endl; ret 0;}
   cout <<"No"<<endl;
}