# 初期入力

import numpy as np

import sys

input = sys.stdin.readline

N = int(eval(input()))

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

A_np =np.array(A,dtype=np.int64)

ans =np.prod(A_np) #累積積

if 0 in A:

    print((0))

elif 0 < ans <=10**18:

    print(ans)

else:

    print((-1))
N = int(eval(input()))

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

A.sort(reverse=True)

#

ans =1

if 0 in A:

    ans =0

else:

    for i in A:

        ans *=i

        if ans >10**18:

            ans =-1

            break

print(ans)
# 初期入力
import numpy as np
import sys

input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
A_np = np.array(A, dtype=np.int64)
ans = np.prod(A_np)  # 累積積
if 0 in A:
    print((0))
elif 0 < ans <= 10**18:
    print(ans)
else:
    print((-1))

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
#
ans = 1
if 0 in A:
    ans = 0
else:
    for i in A:
        ans *= i
        if ans > 10**18:
            ans = -1
            break
print(ans)

-# 初期入力 -import numpy as np -import sys - -input = sys.stdin.readline -A_np = np.array(A, dtype=np.int64) -ans = np.prod(A_np)  # 累積積 +A.sort(reverse=True) +# +ans = 1 -    print((0)) -elif 0 < ans <= 10**18: -    print(ans) +    ans = 0 -    print((-1)) +    for i in A: +        ans *= i +        if ans > 10**18: +            ans = -1 +            break +print(ans)