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

#define ll long long
#define ar array

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	ll n; cin>> n;
	for(int i=1; ; ++i){
		if(stoll(to_string(i)+to_string(i))>n){
			cout<<i-1<<endl;
			break;
		}
	}
	
	return 0;
}

#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define all(nums) nums.begin(), nums.end()
#define allr(nums) nums.rbegin(), nums.rend()
#define len(a) int((a).size())
typedef long long int ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>ordered_set ;
typedef vector<vector<int>> graph;
const ll inf = INT32_MAX;
const ll minf = INT32_MIN;
template<class T>T cal(T n) {return (n*1ll*(n+1))/2;}
template<class T>T mx(T begin, T end){return max_element(begin, end);}
template<class T>T mn(T begin, T end){return min_element(begin, end);}
template<class T>void getUnique(vector<T>& nums){sort(nums.begin(), nums.end()); nums.erase(unique(nums.begin(), nums.end()), nums.end());}
template<class T>void print(vector<T>nums){for(T i:nums)cout<<i<<" ";cout<<"\n";}
template<class T>void read(vector<T>&nums){for(T& i:nums)cin>>i;}

signed main () {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll test = 1;
    // cin >> test;
    while (test--) { 
        int n ;
        cin >> n ;
        vector<int>nums(n) ;
        read(nums) ;
        sort(all(nums)) ;
        bool flag = true ;
        for (int i=1; i<=n; ++i) {
            if (i != nums[i-1]) {
                flag = false ;
                break ;
            }
        }
        cout << (flag ? "Yes" : "No") << "\n" ;
    }

    return 0;
}  
