using System;

namespace ConsoleApp1
{
    class Program
    {

        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var s = Console.ReadLine().Split(' ');
            var a = new int[n];
            int ashurui = 1;
            a[0] = int.Parse(s[0]);
            var savedas = new int[3] { a[0], 0, 0};
            var anum = new int[3] { 1, 0, 0 };
            for (int i = 1; i < n; i++)
            {
                a[i] = int.Parse(s[i]);
                bool isdifferent = true;
                for (int j = 0; j < ashurui; j++)
                {
                    if (a[i] == savedas[j])
                    {
                        isdifferent = false;
                        anum[j]++;
                        break;
                    }
                }
                if (isdifferent)
                {
                    if (ashurui == 3)
                    {
                        Console.WriteLine("No");
                        ashurui++;
                        break;
                    }
                    else
                    {
                        savedas[ashurui] = a[i];
                        anum[ashurui] = 1;
                        ashurui++;
                    }
                }
            }
            if (ashurui < 3)
            {
                if (ashurui == 1)
                {
                    Console.WriteLine("No");
                }
                else if (anum[0] == anum[1] * 2)
                {
                    if (savedas[1] == 0)
                    {
                        Console.WriteLine("Yes");
                    }
                    else
                    {
                        Console.WriteLine("No");
                    }
                }
                else if (anum[0] * 2 == anum[1])
                {
                    if (savedas[0] == 0)
                    {
                        Console.WriteLine("Yes");
                    }
                    else
                    {
                        Console.WriteLine("No");
                    }
                }
            }
            else if (ashurui == 3)
            {
                if ((savedas[0] ^ savedas[1]) == savedas[2] && anum[0] == anum[1] && anum[1] == anum[2])
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }
#if DEBUG
            Console.ReadKey();
#endif
        }
    }
}
