def main():

    n = int(eval(input()))

    a = list(map(int,input().split()))

    x = 1

    if 0 in a:

        print((0))

        return

    for i in a:

        x *= i

        if x > 1000000000000000000:

            print((-1))

            return

    print(x)

main()
def main():

    n = int(eval(input()))

    a = list(map(int,input().split()))

    x = 1

    if 0 in a:

        print((0))

        return

    for i in range(len(a)):

        b = a[i]

        x *= b

        if x > 1000000000000000000:

            print((-1))

            return

    print(x)

main()
def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    x = 1
    if 0 in a:
        print((0))
        return
    for i in a:
        x *= i
        if x > 1000000000000000000:
            print((-1))
            return
    print(x)


main()

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    x = 1
    if 0 in a:
        print((0))
        return
    for i in range(len(a)):
        b = a[i]
        x *= b
        if x > 1000000000000000000:
            print((-1))
            return
    print(x)


main()

-    for i in a: -        x *= i +    for i in range(len(a)): +        b = a[i] +        x *= b