using System;
using System.Linq;

namespace AGC035
{
    class A
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();


            int[] Count = new int[N];
            for (int i = 0; i < N; i++)
            {
                Count[a[i]]++;
            }

            int zeroCount = Count[0];

            if (zeroCount == N) { Console.WriteLine("Yes"); return; }
            if (N % 3 == 0 && zeroCount == N / 3) { Console.WriteLine("Yes"); return; }
            else if (N % 3 != 0 && zeroCount == N / 3 + 1) { Console.WriteLine("Yes"); return; }

            int notZeroCount = Count.Count(x => x != 0);
            if (notZeroCount != 3)
            {
                Console.WriteLine("No"); return;
            }
            else
            {
                int judge = 0;
                for (int i = 0; i < N; i++)
                {
                    if (Count[i] != 0 && Count[i] == N / 3)
                    {
                        judge++;
                    }
                }
                if (judge == 3) { Console.WriteLine("Yes"); return; }
                else { Console.WriteLine("No"); return; }
            }
        }
    }
}
