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

# a[0]^a[1]^a[2] == 0
# a[1]^a[2]^a[3] == 0
# すなわち a[0] == a[3] と出来れば良い
if len(a) % 3 != 0:
    print('No')
elif len(a) == 3:
    if a[0] ^ a[1] ^ a[2] == 0:
        print('Yes')
    else:
        print('No')
else:
    b = list(set(a))
    if len(b) == 3:
        if b[0] ^ b[1] ^ b[2] == 0:
            print('Yes')
            exit()
    print('No')
