n = int(input())
al = list(map(int,input().split()))

for i in range(1,n-1):
    x = al[i-1] ^ al[i+1]
    if x == al[i]:
        continue
    else:
        print('No')
        exit()

if al[-1] ^ al[1] == al[0]:
    pass
elif al[-2] ^ al[0] == al[-1]:
    pass
else:
    print('N0')
print('Yes')