# A - XOR Circle
n=int(input())
a=list(map(int,input().split()))

ok=True
for i in range(n):
    if i==0:
        if a[i]!=a[n-1]^a[i+1]:
            ok=False
            continue
    elif i==n-1:
        if a[i]!=a[i-1]^a[0]:
            ok=False
            continue
        break

    if a[i]!=a[i-1]^a[i+1]:
        ok=False
        break
if ok:
    print('Yes')
else:
    print('No')
