import sys
input=sys.stdin.readline

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

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

h = {}
for i in a:
    if i in h:
        h[i] += 1
    else:
        h[i] = 1
if len(h) != 3:
    print("No")
    exit()
    
a = []
for i in h.keys():
    a.append(int(i))
if a[0] ^ a[1] == a[2]:
    print("Yes")
else:
    print("No")
