def main():
    N = int(input())
    A = list(map(int, input().split()))

    for i in range(N - 1):
        if A[i - 1] ^ A[i + 1] != A[i]:
            print("No")
            return

    if A[-2] ^ A[0] != A[-1]:
        print("No")
        return

    print("Yes")
    return


if __name__ == "__main__":
    main()
