n = int(input())
c = list(map(int, input().split()))
c.sort()
c_set = set(c)
set_list = list(c_set)
ans = 'No'

# 0が混ざっていれば計算方法が違う
if c[0] == 0:
    if n % 3 == 0 and len(c_set) == 2 and c.count(0) == int(n / 3):
        ans = 'Yes'
elif n == 3:
    if c[0] ^ c[1] == c[2]:
        ans = 'Yes'
else:
    if n % 3 == 0 and len(c_set) == 3:
        ank = int(n / 3)
        if c.count(c[0]) == ank and c.count(c[ank]) == ank and set_list[0] ^ set_list[1] == set_list[2]:
            ans = 'Yes'

print(ans)


