#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
//#define mn LLONG_MAX
//#define mx LLONG_MIN
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define pb(a) push_back(a)
ll prime[][2]={{0,0},{2,3},{11,13},{101,103},{1009,1013},
   {10007,10009},{100003,100013},{1000003,1000033},{10000019,10000079},{100000007,100000037}};
ll arr[]={0,1,10,100,1000,10000,100000,1000000,10000000,100000000,100000000,1000000000};
bool sortbysec(const pair<ll,ll>&a,const pair<ll,ll>&b){
         return (a.second<b.second);
          }

bool ff(const pair<int ,int>&a,const pair<int,int>&b)//sorting a parir of first element increasing wise and if they are equal second element in decreasing wise
{if(a.first==b.first)
return (a.second>b.second);
else return (a.first<b.first);}

ll fact(ll n){
           ll ans=1;
           while(n>0){
            ans*=n;
            n--;
           }
           return ans;
           }
 void primme(ll n){

 vector<ll>v(n,0);
 for(ll i=2;i<=n;i++){
              if(v[i]==0){
       for(ll j=i*i;j<=n;j+=i){
         v[j]=1;
       }
 }}

 for(ll i=2;i<=n;i++)
       if(v[i]==0)
       cout<<i<<" ";
cout<<"\n";

 }

void solve(){


ll n;
cin>>n;
ll a[n],i;
map<ll,ll>m;
for(i=0;i<n;i++){
       cin>>a[i];
       m[a[i]]++;
}
while(n){
       if(m[n]!=1)
       {
              cout<<"No\n";
              return;
       }
  --n;
}
cout<<"Yes\n";

}

int main()
   {
    int t=1;
  // cin>>t;
   while(t--)
    solve();

    }

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

int main(){
  int n; cin >> n;
  vector<bool> t(n,false);
  bool ans = true;
  for(int i=0; i<n; i++){
    int a; cin >> a;
    if(t[a-1]) ans = false;
    t[a-1] = true;
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}