N = int(input())
A = list(map(int,input().split()))
As = list(set(A))

flag = 0
if len(As) == 1:
    if As[0] == 0:
        flag = 1
elif len(As) == 2:
    d = {}
    for a in A:
        if a in d.keys():
            d[a] += 1
        else:
            d[a] = 1
    if As[0] == 0 and int(list(set(bin(As[1])[2:]))[0]) == 1 and d[As[0]]*2 == d[As[1]]:
        flag = 1
else:
    if len(As) == 3:
        if As[0]^As[1] == As[2]:
            flag = 1

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