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

public class Hello
{
    private const int MOD_N = 1000000000 + 7;

    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());

        var hist = new Dictionary<uint, int>();

        var list = Console.ReadLine().Split(' ');
        for (int i = 0; i < n; ++i)
        {
            var a = uint.Parse(list[i]);
            int count;
            hist.TryGetValue(a, out count);
            hist[a] = ++count;
        }

        bool result;

        switch (hist.Count)
        {
            case 3:
                {
                    var ass = hist.ToArray();
                    result = ((ass[0].Key ^ ass[1].Key) == ass[2].Key) && ass[0].Value == ass[1].Value && ass[0].Value == ass[2].Value;
                    break;
                }
            case 2:
                {
                    var ass = hist.ToArray();
                    result = (ass[0].Key == 0 && ass[0].Value * 2 == ass[1].Value) || (ass[1].Key == 0 && ass[0].Value == ass[1].Value * 2);
                    break;
                }
            case 1:
                {
                    int count;
                    hist.TryGetValue(0, out count);
                    result = hist.Count == count;
                    break;
                }
            default:
                result = false;
                break;
        }

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

    private static int GCD(int a, int b) => a > b ? GCD_impl(a, b) : GCD_impl(b, a);
    private static int GCD_impl(int a, int b) => b == 0 ? a : GCD_impl(b, a % b);
    private static long LCM(int a, int b) => (long)a * b / GCD(a, b);

    private static int Comb(int m, int n)
    {
        var t = m - n;
        if (n > t)
            n = t;

        long numerator = 1;
        for (int i = 0; i < n; ++i)
        {
            numerator *= m - i;
            numerator %= MOD_N;
        }
        long denominator = 1;
        for (; n != 0; --n)
        {
            denominator *= n;
            denominator %= MOD_N;
        }

        var inv_denominator = ModInv((int)denominator, MOD_N);
        var ret = (int)(numerator * inv_denominator % MOD_N);

        return ret >= 0 ? ret : ret + MOD_N;
    }

    private static int ModInv(int a, int m)
    {
        int b = m, x = 1, y = 0;
        while (b != 0)
        {
            var t = a / b;
            a -= t * b;
            Swap(ref a, ref b);
            x -= t * y;
            Swap(ref x, ref y);
        }
        x %= m;
        return x >= 0 ? x : x + m;
    }

    private static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
}
