n = int(input())
a = list(map(int,input().split()))
a.sort()
#print(n,a)

ans = 0
if n == 3:
    if a[0]^a[1] == a[2]:
        ans = 1
    else:
        ans = 0
elif n == 4:
    if a[0]==0 and a[1]==0 and a[2]==0 and a[3]==0:
        ans = 1
    else:
        ans = 0
else:
    tmp = []
    cnt = []
    for i in range(n):
        if i == 0:
            tmp.append(a[i])
            cnt.append(1)
        else:
            if a[i-1] == a[i]:
                cnt[-1] += 1
            else:
                tmp.append(a[i])
                cnt.append(1)
    if n % 3 != 0:
        if tmp[0] == 0 and cnt[0] == n:
            ans = 1
    else:
        if len(tmp) == 3:
            if cnt[0] == cnt[1] and cnt[1] == cnt[2] and cnt[0]^cnt[1] == cnt[2]:
                ans = 1
        if len(tmp) == 2:
            if tmp[0] == 0:
                if cnt[0]*2 == cnt[1]:
                    ans = 1
        if len(tmp) == 1:
            if tmp[0] == 0:
                ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")