from collections import Counter
n = int(input())
a = [int(item) for item in input().split()]
cnt = Counter(a)
length = len(cnt)
if length == 1:
    if cnt[0] == 0:
        print("No")
    else:
        print("Yes")
elif length == 2:
    if cnt[0] == n // 2 and n % 2 == 0:
        print("Yes")
    else:
        print("No")
elif length == 3:
    val = []
    for key in cnt.keys():
        val.append(key)
    if (val[0] ^ val[1] != val[2]) or (val[1] ^ val[2] != val[0]) or (val[2] ^ val[0] != val[1]):
        print("No")
        exit()
    if n % 3 != 0:
        print("No")
        exit()
    if (cnt[val[0]] != n // 3) or (cnt[val[1]] != n // 3) or (cnt[val[2]] != n // 3):
        print("No")
        exit()
    print("Yes")
else:
    print("No")