using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        static long Mod = (long)1e9 + 7;
        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });            var N = Sarray()[0];
            var N = Sarray()[0];
            var Ai = Sarray();
            if (Ai.Count(a => a == 0) == N)
            {
                WriteLine("Yes");
                return;
            }
            if (N == 3)
            {
                if (
                    (Ai[0] == (Ai[2] ^ Ai[1])) &&
                    (Ai[1] == (Ai[0] ^ Ai[2])) &&
                    (Ai[2] == (Ai[1] ^ Ai[0]))
                    )
                    WriteLine("Yes");
                else
                    WriteLine("No");
                return;
            }
            if (N % 3 != 0)
            {
                WriteLine("No");
                return;
            }
            var aid = Ai.Distinct();
            foreach (var a in aid)
            {
                var cnt = Ai.Count(ai => ai == a);
                var m = N / 3;
                if (0 != cnt % m)
                {
                    WriteLine("No");
                    return;
                }
            }
            WriteLine("Yes");
            //Out.Flush();
        }
    }
}