#include<cstdio>
int solve()
{
	int n,i,a,A=0,AS=1,B=0,BS=1,C=0;
	scanf("%d",&n);
	for(i=1;i<=n;++i)scanf("%d",&a),A?A==a?++AS:B?B==a?++BS:C=1:B=a:A=a;
	if(C)return 0*puts("No");
	if(A<B)A^=B^=A^=B,AS^=BS^=AS^=BS;
	if(B)
	{
		if(B!=A-1)return 0*puts("No");
		if(BS>=A)return 0*puts("No");
		puts(2*(A-BS)>n-BS?"No":"Yes");
	}
	else puts(2*A>n&&A!=n-1?"No":"Yes");
}
int main()
{
	int T=1;
	for(;T--;)solve();
}