import sys

input = sys.stdin.readline

from collections import *



N = int(eval(input()))

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

A.sort()

ans = 1



for Ai in A:

    ans *= Ai

    

    if ans>10**18:

        print((-1))

        exit()

        

print(ans)
import sys

input = sys.stdin.readline



N = int(eval(input()))

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

s = set(A)



if 0 in s:

    print((0))

    exit()



now = 1



for Ai in A:

    if now*Ai>10**18:

        print((-1))

        exit()

    

    now *= Ai



print(now)
import sys

input = sys.stdin.readline
from collections import *

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
ans = 1
for Ai in A:
    ans *= Ai
    if ans > 10**18:
        print((-1))
        exit()
print(ans)

import sys

input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
s = set(A)
if 0 in s:
    print((0))
    exit()
now = 1
for Ai in A:
    if now * Ai > 10**18:
        print((-1))
        exit()
    now *= Ai
print(now)

-from collections import * - -A.sort() -ans = 1 +s = set(A) +if 0 in s: +    print((0)) +    exit() +now = 1 -    ans *= Ai -    if ans > 10**18: +    if now * Ai > 10**18: -print(ans) +    now *= Ai +print(now)