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

from collections import defaultdict
cnt_dict = defaultdict(int)
for a in A:
    cnt_dict[a] += 1

# 全部の排他的論理和を取る
res = A[0]
for a in A[1:]:
    res ^= a

if N%3 != 0:
    start = A[0]
    cnt_dict[start] -= 1
    for i in range(1,N):
        cnt_dict[res^A[i]] -= 1
        if cnt_dict[res^A[i]] < 0:
            print("No")
            quit()
        start = res^A[i]
    else:
        print("Yes")
else:
    lists = []
    for i in range(3):
        for a in A:
            if cnt_dict[a] >0:
                start = a
                break
        cnt_dict[start] -= 1
        seq = [start]
        
        for i in range(1,N//3):
            cnt_dict[res^A[i]] -= 1
            if cnt_dict[res^A[i]] < 0:
                print("No")
                quit()
            start = res^A[i]
            seq.append(start)
        lists += [seq]
    
    # 一通りでも存在するかどうかを確かめる
    for i in lists[1]:
        if lists[0][0]^i in lists[2]:
            print("Yes")
            quit()
    else:
        print("No")