using System;

namespace question1
{
    class Program
    {
        static void Main(string[] args)
        {
            int largeN;
            largeN = int.Parse(Console.ReadLine());
            string[] str = Console.ReadLine().Split(' ');
            int a = -1;
            int b = -1;
            int c = -1;
            //本当に 3 種類か?
            foreach (string tempstr in str)
            {
                int test = int.Parse(tempstr);
                if (test != a && test != b && test != c)
                {
                    if (a == -1) a = test;
                    else if (b == -1) b = test;
                    else if (c == -1) c = test;
                    else
                    {
                        Console.WriteLine("No");
                        Environment.Exit(0);
                    }
                }
            }
            //数のカウント
            int ac = 0;
            int bc = 0;
            int cc = 0;


            foreach (string tempstr in str)
            {
                int test = int.Parse(tempstr);
                if (test == a) ac += 1;
                else if (test == b) bc += 1;
                else if (test == c) cc += 1;
            }

            if (a == -1) a = 0;
            if (b == -1) b = 0;
            if (c == -1) c = 0;

            if (ac==bc && bc == cc)
            {
                if ((a ^ b ^ c) == 0) Console.WriteLine("Yes");
                else Console.WriteLine("No");
            }
            else if (bc==0 && cc==0) Console.WriteLine("No");
            else if (bc != 0 && cc==0){
                if ((a == 0) && (ac * 2 == bc)) Console.WriteLine("Yes");
                if ((b == 0) && (bc * 2 == ac)) Console.WriteLine("Yes");
            }

            else Console.WriteLine("No");


        }
    }
}
