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 and e != f]

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

print(result)