import sys
from collections import deque, defaultdict
import copy
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

N = int(input())
a = list(map(int, input().split()))

if N % 3 != 0:
    print("No")
    exit()

numnum=defaultdict(int)
for i in range(N):
    numnum[a[i]]+=1

if len(numnum) != 3:
    print("No")
    exit()

for num in numnum:
    if numnum[num] != N//3:
        print("No")
        exit()

num3=[]
for num in numnum:
    num3.append(num)

if num3[0]^num3[1] == num3[2]:
    print("Yes")
    exit()
else:
    print("No")
    exit()