n = int(eval(input()))

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

ans = 1

for num in sorted(a):

    ans *= num

    if ans > 10**18:

        print("-1")

        exit()

print(ans)
def main ():

    N = int(eval(input()))

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

    if 0 in A:

        print((0))

        return

    

    prod = 1

    for a in A:

        prod *= a

        if prod > 1000000000000000000:

            print((-1))

            return

    print(prod)

    

main ()
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
for num in sorted(a):
    ans *= num
    if ans > 10**18:
        print("-1")
        exit()
print(ans)

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


main()

-n = int(eval(input())) -a = list(map(int, input().split())) -ans = 1 -for num in sorted(a): -    ans *= num -    if ans > 10**18: -        print("-1") -        exit() -print(ans) +def main(): +    N = int(eval(input())) +    A = list(map(int, input().split())) +    if 0 in A: +        print((0)) +        return +    prod = 1 +    for a in A: +        prod *= a +        if prod > 1000000000000000000: +            print((-1)) +            return +    print(prod) + + +main()