n = int(input())
nums = list(map(int, input().split()))

unq = list(set(nums))


def answer(ans):
    print(ans)
    exit()

if len(unq) > 3:answer("No")

if len(unq) == 3:
    a,b,c = unq
    if a ^ b ^ c != 0:answer("No")
    if nums.count(a) == nums.count(b) == nums.count(c):answer("Yes")
    else:answer("No")

if len(unq) == 2:
    a,b = sorted(unq)
    if a != 0:answer("No")
    if nums.count(a) * 2 == nums.count(b):answer("Yes")
    else: answer("No")

if len(unq) == 0:
    a = unq[0]
    if a != 0:answer("No")
    else:answer("Yes")