
import collections
N = int(input())

L = list(map(int,input().split()))
C = collections.Counter(L)
flg = False
if len(C)>3:
    print('No')
    exit()

if len(C)==3:
    ans = 0
    cnt = []
    for i,v in C.items():
        ans ^= i
        cnt.append(v)
    if ans == 0 and max(cnt) == min(cnt):
        print('Yes')
        exit()
if len(C) == 2:
    if C[0] == 0:
        print('No')
        exit()
    x,y = C.values()
    if x//3==y or y//3==x:
        print('Yes')
        exit()
    else:
        print('No')
        exit()
if len(C) == 1:
    if C[0]>0:
        print('Yes')
        exit()
