N=int(input())
A = list(map(int,input().split()))
result = 'No'
temp = [0] * N
temp[0] = A[0]
temp[1] = A[1]
del A[0]
del A[0]
isOK = 'NG'
if(N == 3):
    temp[2] = A[0]
    del A[0]
    if(temp[0]^temp[1] == temp[N-1] and temp[N-2]^temp[N-1] == temp[0]):
        print('Yes')
    else:
        print('No')
else:
    for i in range(2,N):
        count = 0
        isOK = 'NG'
        for j in A:
            if(temp[i-2]^temp[i-1] == j):
                temp[i] = j
                del A[count]
                count += 1
                isOK = 'OK'
                break
        if(isOK == 'NG'):
            break
    if(isOK == 'NG'):
        print('No')
    else:
        if(temp[0]^temp[1] == temp[N-1] and temp[N-2]^temp[N-1] == temp[0]):
            print('Yes')
        else:
            print('No')