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

if N % 3 == 0 and len(num) == 3 and num[0] ^ num[1] == num[2]:
    print('Yes')
elif len(num) <= 2 and num[0] == 0:
    print('Yes')
else:
    print('No')