using System;

namespace question1
{
    class Program
    {
        static void Main(string[] args)
        {
            int flag = 1;
            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
                    {
                        flag = 0;
                        //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 == b && b == c) flag = 1;
            else flag = 0;

            //唯一、数字が 2 種類で片方が0、かつ個数比がぴったりなら
            if (c == -1 && b != -1)
            {
                if ((a == 0) && (ac + ac == bc)) flag = 1;
                if ((b == 0) && (bc + bc == ac)) flag = 1;

            }
            else
            {

                if (a == -1) a = 0;
                if (b == -1) b = 0;
                if (c == -1) c = 0;
                //Console.WriteLine(a^b^c);
                if (0 == (a ^ b ^ c)) flag = 1;// Console.WriteLine("Yes");
                else flag = 0; //Console.WriteLine("No");
            }
                if (flag == 1) Console.WriteLine("Yes");
                else Console.WriteLine("No");

            
            Console.ReadLine();
            
        }
    }
}