# A
N = int(input())
a = list(map(int, input().split()))
flag = True
if max(a) == 0:
    print('Yes')
else:
    if N % 3 != 0:
        print('No')
    else:
        n = int(N / 3)
        a = sorted(a)
        t = []
        for i in range(3):
            tmp_list = a[n * i : n * (i + 1)]
            t.append(a[n * i])
            if i == 2:
                if min(tmp_list) == max(tmp_list):
                    if t[0] == t[1] ^ t[2] and t[1] == t[2] ^ t[0] and t[2] == t[0] ^ t[1]:
                        pass
                    else:
                        flag = False
                elif t[0] == 0 and t[1] == t[2]:
                    pass
                else:
                    flag = False
        if flag:
            print('Yes')
        else:
            print('No')