n=int(input())
A=map(int,input().split())
c=list(A)
s=0
a=sorted(c)

if n!=3:
    for i in range(0,n-2):
        if  (bin(a[i] ^ a[i+2]))==bin(a[i+1]):
            continue
        else:
            s=1

    if  (bin(a[n-1] ^ a[1]))==bin(a[0]):
        f=0
    else:
        s=1

    if  bin((a[n-2] ^ a[0]))==bin(a[n-1]):
        f=0
    else:
        s=1



else:
    if  (bin(a[0] ^ a[1]))==bin(a[2]):
        f=0
    else:
        s=1
    if  (bin(a[1] ^ a[2]))==bin(a[0]):
        f=0
    else:
        s=1
    if  (bin(a[2] ^ a[0]))==bin(a[1]):
        f=0
    else:
        s=1

if s==1:
    print('No')
else:
    print('Yes')