N = int(input())
a = list(map(int, input().split()))
b = list(set(a))
flag = False
if len(b) == 3:
    if b[0] ^ b[1] == b[2]:
        flag = True
if len(b) == 1:
    if b[0] == 0:
        flag = True
if len(b) == 2:
    if 0 in b and a.count(0) == N // 3:
            flag = True


if flag:
    print('Yes')
else:
    print('No')