using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class A
{
	public static void Main()
	{
		int N = GetInt();
		int[] a = new int[N];
		var num = new Dictionary<int, int>();
		for(int i = 0; i < N; i++)
		{
			a[i] = GetInt();
			num.TryGetValue(a[i], out int tmp);
			num[a[i]] = tmp + 1;
		}

		int count = num.Keys.Count;
		if(N % 3 == 0)
		{
			switch(count)
			{
				case 1:
					Console.WriteLine((a[0] == 0) ? "Yes" : "No");
					return;

				case 2:
					int tmp = 0;
					if(num.TryGetValue(0, out tmp) && (tmp == N/3))
						Console.WriteLine("Yes");
					else
						Console.WriteLine("No");
					return;

				case 3:
					foreach(int val in num.Values)
					{
						if(val != N/3)
						{
							Console.WriteLine("No");
							return;
						}
					}

					int xor = 0;
					foreach(int key in num.Keys)
						xor ^= key;
				
					Console.WriteLine((xor == 0) ? "Yes" : "No");
					return;

				default:
					Console.WriteLine("No");
					return;
			}
		}
		else
		{
			if((count == 1) && (a[0] == 0))
				Console.WriteLine("Yes");
			else
				Console.WriteLine("No");
		}
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}