#include <bits/stdc++.h>
#define int long
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
int gcd(int a,int b){return b ? gcd(b,a%b) : a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}

main() {
    int N; cin >> N; bool can = false;
    map<int,int> m;
    rep(i,N){
        int a; cin >> a;
        m[a]++;
    }
    if(m.size()==1 && m[0]==N) can = true;
    else if(m.size()==3 && N%3==0){
        bool can2 = true;
        for(auto p:m){
            if(p.second!=N/3) can2 = false;
        }
        if(can2) can = true;
    }
    else if(m.size()==2 && N%3==0){
        bool can3 = true;
        for(auto p:m){
            if(p.second==N*2/3 || p.second==N/3 && p.first==0);
            else can3=false;
        }
        if(can3) can = true;
    }
    cout << (can ? "Yes" : "No") << endl;

    return 0;
}
