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]];
            }

            if(mp.Count == 1 && mp.ContainsKey(0))
            {
                Console.WriteLine("Yes");
                return;
            }

            if(mp.Count > 3)
            {
                Console.WriteLine("No");
                return;
            }

            if(N == 3 && (A[0] ^ A[1] ^ A[2]) == 0)
            {
                Console.WriteLine("Yes");
                return;
            }


            if (mp.Count == 2)
            {
                if(!mp.ContainsKey(0))
                {
                    Console.WriteLine("No");
                    return;
                }
                int[] vl = mp.OrderBy(x => x.Key).Select(x => x.Value).ToArray();
                if(2 * vl[0] == vl[1])
                    Console.WriteLine("Yes");
                else
                    Console.WriteLine("No");
                return;
            }

            KeyValuePair<int, int>[] kvp = mp.OrderBy(x => x.Value).ToArray();
            if ((kvp[0].Key ^ kvp[1].Key ^ kvp[2].Key) == 0 && kvp[0].Value == kvp[1].Value && kvp[1].Value == kvp[2].Value)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");
       }
    }
}