n = int(input())
l = list(map(int,input().split()))
j = 0
u = []
v = [0]*3
for i in l:
    if not i in u :
        u.append(i)
    else:
        v[u.index(i)] += 1
    if len(u) > 3:
        break
#print(u,v)
if ((n%3 == 0) and (u[0] ^ u[2] == u[1]) and (v[0] == v[1] and v[1] == v[2]) and not len(u) > 3):
    j = 1
if j == 1 :
    print("Yes")
else :
    print("No")
#print(l[0] ^ l[2] == l[1],n == 3)
"""01
10
11
01
10
11

01
00
01
01
00
01
"""
