import sys

N = int(input())
a = list(map(int, input().split()))

if N == 3:
    a.append(a[0])
    a.append(a[1])
    for i in range(N):
        if a[i] != a[i+1] ^ a[i+2]:
            print("No")
            sys.exit()
    print("Yes")
else:
    if sum(a) == 0:
        print("Yes")
    else:
        print("No")