n = int(input())
a = list(map(int, input().split()))
b = list(set(a))

if sum(a) == 0:
    pass
elif a.count(max(b)) == 2*n/3 and a.count(0) == n/3:
    pass
elif b[0] ^ b[1] == b[2]:
    pass
else:
    print("No")
    exit()
    
print("Yes")