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

typedef long long int ll;

const ll MOD=((1e9)+7);

bool sortcol( const vector<ll>& v1,const vector<ll>& v2 ) 
{
	return v1[0] < v2[0];
}

int main()
{
	ll n, su=0;
	cin>>n;
	set<ll> s;
	for (ll i=1; i<=n; i++)
	{
		ll p;
		cin>>p;
		su+=p;
		s.insert(p);
	}
	if (s.size()==n)
	{
		if (su==(n*(n+1))/2)
		{
			cout<<"Yes";
		}
		else cout<<"No";
	}
	else cout<<"No";
	return 0;
}





#include <bits/stdc++.h>
#define x first
#define y second
#define endll '\n'
#define pb push_back
#define mem(x,a) memset(x,a,sizeof(x))
using namespace std;
const int N=1e5+10,mod=19650827;
const int inf=0x3f3f3f3f;
typedef long long ll;
typedef pair<int,int> pii;
typedef unsigned long long ull;
int n,k,m;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}
	while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
	return x*f;
}
int a[111],b[111];
bool check(int x){
    for(int i=1;i<=n;i++){
        if(a[i]>x||b[i]<x)return false;
    }
    return true;
}
void work(){
    n=read();
    for(int i=1;i<=n;i++)a[i]=read();
    for(int i=1;i<=n;i++)b[i]=read();
    int res=0;
    for(int i=1;i<=1000;i++){
        if(check(i))res++;
    }
    cout<<res;
}
int main(){
    //int T=read();
    //while(T--)
        work();
    return 0;
}
