using System;
using System.Linq;
using System.Collections.Generic;

namespace AtCoder035
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = Convert.ToInt32(Console.ReadLine());
            int[] A = Console.ReadLine().Split().Select(x => Convert.ToInt32(x)).ToArray();
            IDictionary<int, int> mp = new Dictionary<int, int>();
            for(int i = 0; i < N; ++i)
            {
                if (!mp.ContainsKey(A[i]))
                    mp.Add(A[i], 0);
                ++mp[A[i]];
            }

            List<int> ls = new List<int>();
            foreach (var pk in mp)
            {
                if (mp.ContainsKey(pk.Key ^ A[0]))
                {
                    ls.Add(A[0]);
                    ls.Add(pk.Key ^ A[0]);
                    ls.Add(pk.Key);
                    if (mp[pk.Key] > 1)
                        --mp[pk.Key];
                    else
                        mp.Remove(pk.Key);
                    break;
                }
            }
            if(ls.Count < 3)
            {
                Console.WriteLine("No");
                return;
            }
            for (int i = 3 ; i < N; i++)
            {
                int k = ls[i - 1] ^ ls[i - 2]; 
                if (mp.ContainsKey(k))
                {
                    ls.Add(k);
                    if (mp[k] > 1)
                        --mp[k];
                    else
                        mp.Remove(k);
                }else
                {
                    Console.WriteLine("No");
                    return;
                }
            }

            if ((ls[N - 2] ^ ls[0]) == ls[N - 1])
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");
        }
    }
}
