N = int(input())
a = list(map(int, input().split()))
a_set = set(a)
if len(a_set) == 1:
    if a_set == {0}:
        print('Yes')
    else:
        print('No')
elif len(a_set) == 2:
    a_set = list(a_set)
    c = a_set[0] ^ a_set[1]
    if N % 3 == 0 and a.count(a_set[0]) == a.count(a_set[1]) and (c == a_set[0] or c == a_set[1]):
        print('Yes')
    else:
        print('No')
elif len(a_set) == 3:
    a_set = list(a_set)
    flag = 0
    if a.count(a_set[0]) == a.count(a_set[1]) and a.count(a_set[0]) == a.count(a_set[2]):
        flag = 1
    if N % 3 == 0 and flag == 1 and a_set[0] ^ a_set[1] == a_set[2]:
        print('Yes')
    else:
        print('No')
else:
    print('No')
