n = int(input())
a = list(map(int, input().split()))
flag = True
for i in range(n):
    if(i == n - 1):
        if(a[0]^a[n-2] != a[n-1]):
            flag = False
    else:
        if (a[i-1] ^ a[i+1] != a[i]):
            flag = False

if(flag):
    print("Yes")
else:
    print("No")