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

if( (a[-1] ^ a[1]) != a[0]):
    flag != False
if( (a[-2] ^ a[0]) != a[-1]):
    flag != False

for i in range(1, N-1):
    if( (a[i-1] ^ a[i+1]) != a[i]):
        flag = False

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