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

public class Solution
{
    public static void Main()
    {
        var N = int.Parse(Console.ReadLine());
        var a = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        var grouped = a.GroupBy(v => v).ToList();

        if (grouped.Count > 3)
        {
            Console.WriteLine("No");
            return;
        }

        var keys = grouped.Select(g => g.Key).ToList();
        var counts = grouped.Select(g => g.Count()).ToList();

        switch (grouped.Count)
        {
            case 1:
                if ((keys[0] ^ keys[0]) == keys[0])
                {
                    Console.WriteLine("Yes");
                    return;
                }
                break;
            case 2:
                if ((keys[0] ^ keys[1]) == keys[0] && counts[0] == counts[1])
                {
                    Console.WriteLine("Yes");
                    return;
                }
                break;
            case 3:
                if ((keys[0] ^ keys[1]) == keys[2] && counts[0] == counts[1] && counts[0] == counts[2])
                {
                    Console.WriteLine("Yes");
                    return;
                }
                break;
        }

        Console.WriteLine("No");
    }
}