from collections import Counter
N = int(input())
a = list(map(int,input().split()))
if not (not 0) in a:
    print('Yes')
else:
    if len(a)%3 != 0:
        print('No')
    else:
        dicta = Counter(a)
        keys = list(dicta.keys())
        if len(keys) == 1:
            if 0 in dicta:
                print('Yes')
            else:
                print('No')
        elif len(keys) == 2:
            if dicta[0] == N//3:
                print('Yes')
            else:
                print('No')
        elif len(keys) == 3:
            flag = True
            for j in dicta.values():
                if j != N//3:
                    print('No')
                    flag = False
            if flag:
                if keys[0]^keys[1]^keys[2] == 0:
                    print('Yes')
                else:
                    print('No')
                
        else:
            print('No')
        