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

if N<3:
    print('No')
    exit()

A_set=set(A)
A_lst=list(A_set)

if len(A_set)==0 and sum(A_set):
    print('Yes')
    exit()

if len(A_set)==3 and len(A)%3==0 and A_lst[0]^A_lst[1]^A_lst[2]==0:
    print('Yes')
    exit()

if len(A_set)==2 and len(A)%3==0 and sum(A_lst)^sum(A_lst)^0==0 and 0 in A_lst:
    print('Yes')
    exit()

print('No')