using System;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.IO;


namespace SolutionCS
{
    class Program
    {
        class CountedHashSet
        {
            public class Counter
            {
                public Counter()
                {
                    count = 1;
                }

                public int count { get; set; }
            }


            public Dictionary<int, Counter> keySet;

            public CountedHashSet()
            {
                keySet = new Dictionary<int, Counter>();
            }

            public void Add(int key)
            {
                Counter c;

                if (keySet.TryGetValue(key, out c))
                {
                    c.count++;
                }
                else
                {
                    keySet.Add(key, new Counter());
                }
            }

            public int GetKeyCount(int key)
            {
                Counter c;

                if (keySet.TryGetValue(key, out c))
                {
                    return c.count;
                }

                return 0;
            }
        }

        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');

            CountedHashSet hs = new CountedHashSet();

            for (int i = 0; i < N; i++)
            {
                hs.Add(int.Parse(s[i]));
            }

            if (hs.keySet.Count == 1)
            {
                if (hs.keySet.ContainsKey(0))
                {
                    Console.WriteLine("Yes");
                    return;
                }
                Console.WriteLine("No");
                return;
            }
            if (hs.keySet.Count <= 2)
            {
                int countZ = 0;
                int countNZ = 0;

                foreach (KeyValuePair<int, CountedHashSet.Counter> e in hs.keySet)
                {
                    if ( e.Key == 0)
                    {
                        countZ = e.Value.count;
                    }
                    else
                    {
                        countNZ = e.Value.count;
                    }
                }

                if ( countZ * 2 != countNZ)
                {
                    Console.WriteLine("No");
                    return;
                }
                Console.WriteLine("Yes");
                return;
            }

            if ( hs.keySet.Count != 3)
            {
                Console.WriteLine("No");
                return;
            }

            if (hs.keySet.ContainsKey(0))
            {
                Console.WriteLine("No");
                return;
            }

            int ans = 0;
            int prevCount = -1;
            foreach(KeyValuePair<int,CountedHashSet.Counter> e in hs.keySet)
            {
                ans ^= e.Key;

                if ( prevCount > 0)
                {
                    if (prevCount != e.Value.count)
                    {
                        Console.WriteLine("No");
                        return;
                    }
                }

                prevCount = e.Value.count;
            }

            if (0 != ans)
            {
                Console.WriteLine("No");
                return;
            }

            Console.WriteLine("Yes");
        }
    }
}


Measured memory_bytes: 31580