using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    public struct Pair { public int x, y; public Pair(int x, int y) { this.x = x; this.y = y; } }
    public static void Solve()
    {
        int N = NextInt();
        if (N % 3 != 0) ;
        int[] A = LineInt();
        Array.Sort(A);
        int a = -1, b = -1, c = -1;
        for (int i = 0; i < N; i++)
        {
            if (a == -1) a = A[i];
            else if (a != A[i] && b == -1) b = A[i];
            else if (b != A[i] && c == -1) c = A[i];
            else if (c != -1 && c != A[i]) { Console.WriteLine("No"); return; }
        }
        if (b == -1)
        {
            if (a == 0) Console.WriteLine("Yes");
            else Console.WriteLine("No");
        }
        else if (c == -1)
        {
            if (N % 3 == 0 && a == 0 && (A.Count(v => v == a) == (N / 3) &&
                A.Count(v => v == b) == (N * 2 / 3))) Console.WriteLine("Yes");
            else Console.WriteLine("No");
        }
        else
        {
            int xor = a ^ b ^ c;
            if (N % 3 != 0 || xor != 0) Console.WriteLine("No");
            else if ((A.Count(v => v == a) == (N / 3) &&
                A.Count(v => v == b) == (N / 3) &&
                A.Count(v => v == c) == (N / 3))) Console.WriteLine("Yes");
            Console.WriteLine("No");
        }
    }
    public static void Main()
    {
        var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }
}
public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}
