N = int(input())
inputs = [int(i) for i in input().split()]

set_inputs = set(inputs)
if N % 3 == 0:
    list_inputs = list(set_inputs)
    if len(set_inputs) == 3 and list_inputs[0] == (list_inputs[1] ^ list_inputs[2]) and (inputs.count(list_inputs[0]) == inputs.count(list_inputs[1]) == inputs.count(list_inputs[2])):
        print('Yes')
    else:
        print('No')
else:
    if set_inputs == set([0]):
        print('Yes')
    else:
        print('No')