N = int(input())
nums = list(map(int, input().split()))

start = nums[0]
firsts = [[start, num, start^num] for num in nums if start^num in nums]

result = 'No'

for s, n, f in firsts:
    lists = [e for e in nums if e != s and e != n]
    for i in range(100000):
        if len(lists) < 2:
            break
        n2 = s ^ n
        if n2 in lists:
            lists = [e for e in lists if e != s and e != n]
            s = n
            n = n2
        else:
            break

    if len(lists) <= 1 and s ^ n == f:
        result = 'Yes'
        break

print(result)