#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;cin>>N;
    std::vector<int> a(N);
    std::set<int> s;
    for(int i=0;i<N;i++){
        cin>>a.at(i);
        s.insert(a.at(i));
    }
    
    if(*rbegin(s)==0&&s.size()==1){
        cout<<"Yes"<<endl;
        return 0;
    }
    else if(s.size()==2&&*begin(s)==0){
        cout <<"Yes"<<endl;
        return 0;
    }
    else if(s.size() != 3){
        cout<<"No"<<endl;
        return 0;
    }
    else{
        vector<int> c(3),d(3, 0);
        c.at(0) = *begin(s);
        c.at(1) = *rbegin(s);
        s.erase(c.at(0));
        c.at(2) = *begin(s);
        for(int i=0;i<N;i++){
            for(int j=0;j<3;j++){
                if(c.at(j)==a.at(i)) d.at(j)++;
            }
        }
        if(d.at(0)==d.at(1)&&d.at(0)==d.at(2)){
            cout <<"Yes"<<endl;
        }
        else cout <<"No "<<endl;
    }
}