N=int(input())
a=list(map(int,input().split()))
sum=0
realsum=0
if N%3!=0:
    for j in a:
        realsum+=j
        if realsum==0:
            print('Yes')
        else:
            print('No')
else:
    for i in a:
        sum=sum^i
    if sum==0:
        print('Yes')
    else:
        print('No')


