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

start = nums[0]

result = 'No'

for num in nums:
    if start ^ num not in nums:
        continue
    lists = [e for e in nums if e != start and e != num and e != start^num]

    if len(lists) == 0 and start ^ num == start^num:
        result = 'Yes'
        break

print(result)