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

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