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

a_i_set = list(set(a_i))

if len(a_i_set) == 3:
    if(a_i_set[0] ^ a_i_set[1] == a_i_set[2] and \
       a_i_set[1] ^ a_i_set[2] == a_i_set[0] and \
       a_i.count(a_i_set[0]) == a_i.count(a_i_set[1]) == a_i.count(a_i_set[2])):
        print("Yes")
    else:
        print("No")
else:
    print("No")
