def main():

    N=int(eval(input()))

    X=input().split()

    if "0" in X:

        print((0))

        return

    ans=1

    for i in X:

        ans = int(i) * ans

        if 1e18<ans:

            print((-1))

            return

    print(ans)

main()
def main():

    N=int(eval(input()))

    X=input().split()

    if "0" in X:

        print((0))

        return

    ans=1

    for i in X:

        ans = int(i) * ans

        if 1000000000000000000<ans:

            print((-1))

            return

    print(ans)

main()
def main():
    N = int(eval(input()))
    X = input().split()
    if "0" in X:
        print((0))
        return
    ans = 1
    for i in X:
        ans = int(i) * ans
        if 1e18 < ans:
            print((-1))
            return
    print(ans)


main()

def main():
    N = int(eval(input()))
    X = input().split()
    if "0" in X:
        print((0))
        return
    ans = 1
    for i in X:
        ans = int(i) * ans
        if 1000000000000000000 < ans:
            print((-1))
            return
    print(ans)


main()

-        if 1e18 < ans: +        if 1000000000000000000 < ans: