#include <bits/stdc++.h>
using namespace std;
int main(){
long long counter;
counter=0;
int N; cin>>N;
int b,c=0;
int a1,a2,a3;
set<int> S;
int a[N]={0};
for(int i=0;i<N;i++){
cin>>b;
if(!S.count(b))
{S.insert(b);
 a[b]++;}
if(S.size()==4){
c++;
break;}}
if(c==1){
cout<<"No"<<endl;}
else if(S.count(0)){
if(S.size()==1){
cout<<"Yes"<<endl;}
else if(S.size()==2){
if(a[0]*2-1==a[*begin(S)]||a[0]*2==a[*begin(S)]){
cout<<"Yes"<<endl;}
else{
cout<<"No"<<endl;}}}
else if(S.size()==3){
a1=*begin(S);
S.erase(a1);
a2=*begin(S);
S.erase(a2);
a3=*begin(S);
S.erase(a3);
if(a[a1]==a[a2]&&a[a2]==a[a3]){
cout<<"Yes"<<endl;}
else{
cout<<"No"<<endl;}}}