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

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = ReadInt();
            var a = ReadArrayInt();
            var cnt = a.Distinct().Count();
            var even = a.Distinct().Where(i => i % 2 == 0).ToArray();
            var odd = a.Distinct().Where(i => i % 2 != 0).ToArray();
            var ans = true;
            if (cnt == 1)
            {
                if (a[0] == 0) ans = true;
                else ans = false;
            }
            else if (cnt == 2)
            {
                if (!(even.Count() == 1 && odd.Count() == 1)) ans = false;
                else
                {
                    var evenCnt = a.Count(i => i == even[0]);
                    var oddCnt = a.Count(i => i == odd[0]);
                    if (evenCnt * 2 != oddCnt) ans = false;
                    else
                    {
                        if ((odd[0] ^ odd[0]) != even[0]) ans = false;
                        else if ((even[0] ^ odd[0]) != odd[0]) ans = false;
                    }
                }
            }
            else if (cnt == 3)
            {
                if (!(even.Count() == 1 && odd.Count() == 2)) ans = false;
                else
                {
                    var evenCnt = a.Count(i => i == even[0]);
                    var odd1Cnt = a.Count(i => i == odd[0]);
                    var odd2Cnt = a.Count(i => i == odd[1]);
                    if (!(evenCnt == odd1Cnt && odd1Cnt == odd2Cnt)) ans = false;
                    else if ((odd[0] ^ odd[1]) != even[0]) ans = false;
                    else if ((even[0] ^ odd[1]) != odd[0]) ans = false;
                    else if ((even[0] ^ odd[0]) != odd[1]) ans = false;
                }
            }
            else ans = false;

            Console.WriteLine(ans ? "Yes" : "No");
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}
