n=int(input())
a=list(map(int,input().split()))
an="Yes"

for i in range(n):
    if i==0:
        if (a[-1]^a[i+1])!=a[i]:
            print("No")
            exit()
    elif i==n-1:
        if (a[0]^a[-2])!=a[i]:
            print("No")
            exit()
    else:
        if (a[i-1]^a[i+1])!=a[i]:
            print("No")
            exit()

print(an)