def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    for i in range(N-2):
        if A[i] ^ A[i+1] != A[i+2]:
            print("No")
            break
    else:
        if A[N-2] ^ A[N-1] == A[0] and A[N-1] ^ A[0] == A[1]:
            print("Yes")
        else:
            print("No")
if __name__ == '__main__':
    main()