from collections import defaultdict
n = int(input())
result = False
if n % 3 == 0:
    numbers = defaultdict(int)
    inputNum = list(input().split())
    for i in range(n):
        numbers[inputNum[i]] += 1
    if len(numbers) == 3:
        vals = list(numbers.values())
        if vals[0] == vals[1] and vals[1] == vals[2]:
            keys = list(numbers.keys())
            if int(keys[0]) ^ int(keys[1]) == int(keys[2]):
                result = True

if result == True:
    print("Yes")
else:
    print("No")