from collections import Counter
N = int(input())
a_array = list(map(int, input().split()))

a = Counter(a_array)

if len(a) == 1 and a[0] == N:
    print("Yes")
    exit()


if len(a) == 3:
    i_array = []
    for i, x in a.items():
        i_array.append(i)
        if x != N // 3:
            print("No")
            exit()
    else:
        if i_array[0] ^ i_array[1] == i_array[2]:
            print("Yes")
            exit()
        else:
            print("No")
else:
    print("No")
    exit()
