#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
//typedef long long int ll;
typedef unsigned long long int ll;  
//typedef pair<ll, ll> pd;
const int mod = 1e9 + 7;
//#define int long long 
int gcd(int a, int b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
     
}


void solve(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    set<int> s;
    for(auto x: a){
        s.insert(x);
    }
    int num = 1;
    for(auto x: s){
        if(x!=num){
            cout<<"No\n";
            return;
        }
        num++;
    }
    if(num==n)cout<<"No\n";
    else cout<<"Yes\n";
}   

int32_t main(){
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //#endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1;
    //cin>>t;
    for(int i=1;i<=t;i++){
        solve();
    }
    return 0;
}
#include <iostream>
#include <deque>
#include <climits>

int search(int lhs, const std::deque<int>& rhs) {
    if (rhs.size() == 0) {
        return lhs;
    }
    int min = INT_MAX;
    for (int i = 1; i <= rhs.size(); i++) {
        int n = 0;
        auto copied = rhs;
        for (int j = 0; j < i; j++) {
            n |= copied[0];
            copied.pop_front();
        }
        const int branch_result = search(lhs ^ n, copied);
        if (branch_result < min) {
            min = branch_result;
        }
    }
    return min;
}

int main() {
    int N;
    std::deque<int> A;
    std::cin >> N;
    for (int i = 0; i < N; i++) {
        int n;
        std::cin >> n;
        A.push_back(n);
    }
    // std::cout << N << std::endl;
    // for (int i = 0; i < A.size(); i++) {
    //     std::cout << i << std::endl;
    // }
    const int result = search(0, A);
    std::cout << result << std::endl;
    return 0;
}
