from collections import Counter

N = int(inputs[0])
a_list = list(map(int, inputs[1].split()))

def check(N, a_list):
    mc = Counter(a_list).most_common()
    n = len(mc)
    if n == 1:
        if mc[0][0] == 0:
            print('Yes')
            return
    elif n == 2:
        if mc[0][1] == 2*N // 3 and mc[1][0] == 0:
            print('Yes')
            return
    elif n == 3:
        if mc[0][1] == mc[1][1] == mc[2][1] and mc[0][0] ^ mc[1][0] ^ mc[2][0] == 0:
            print('Yes')
            return
    print('No')

check(N, a_list)