import sys



sys.setrecursionlimit(10 ** 9)

input = sys.stdin.readline



N = int(eval(input()))

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



A = sorted(A)



total = A[0]

limit = 10 ** 18



for a in A[1:]:

    total *= a

    if total > limit:

        print((-1))

        exit()

print(total)

import sys



sys.setrecursionlimit(10 ** 9)

input = sys.stdin.readline



N = int(eval(input()))

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



limit = 10 ** 18

A = sorted(A)



total = A[0]

if total == 0:

    print(total)

    exit()



for a in A[1:]:

    total *= a

    if total > limit:

        print((-1))

        exit()

print(total)

import sys

sys.setrecursionlimit(10**9)
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
A = sorted(A)
total = A[0]
limit = 10**18
for a in A[1:]:
    total *= a
    if total > limit:
        print((-1))
        exit()
print(total)

import sys

sys.setrecursionlimit(10**9)
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
limit = 10**18
A = sorted(A)
total = A[0]
if total == 0:
    print(total)
    exit()
for a in A[1:]:
    total *= a
    if total > limit:
        print((-1))
        exit()
print(total)

+limit = 10**18 -limit = 10**18 +if total == 0: +    print(total) +    exit()