import math

n = int(eval(input()))

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

lg = 0

for a in A:

    if a == 0:

        print((0))

        exit()

    lg += math.log10(a)

if lg > 18:

    print((-1))

else:

    ans = 1

    for a in A:

        ans *= a

    if ans > 10**18:

        print((-1))

    else:

        print(ans)
n = int(eval(input()))

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

ans = 1

if 0 in set(A):

    print((0))

    exit()

for a in A:

    ans *= a

    if ans > 10**18:

        print((-1))

        exit()

print(ans)
import math

n = int(eval(input()))
A = list(map(int, input().split()))
lg = 0
for a in A:
    if a == 0:
        print((0))
        exit()
    lg += math.log10(a)
if lg > 18:
    print((-1))
else:
    ans = 1
    for a in A:
        ans *= a
    if ans > 10**18:
        print((-1))
    else:
        print(ans)

n = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
if 0 in set(A):
    print((0))
    exit()
for a in A:
    ans *= a
    if ans > 10**18:
        print((-1))
        exit()
print(ans)

-import math - -lg = 0 +ans = 1 +if 0 in set(A): +    print((0)) +    exit() -    if a == 0: -        print((0)) -        exit() -    lg += math.log10(a) -if lg > 18: -    print((-1)) -else: -    ans = 1 -    for a in A: -        ans *= a +    ans *= a -    else: -        print(ans) +        exit() +print(ans)