N = int(eval(input()))

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

num = 1

for i in range(0,N):

    if A[i]==0:

      	num=0

      	break

for i in range(0,N):

    if num>10**18:

        break

    else:

        num *=A[i]

if num>10**18:

    print((-1))

else:

    print(num)
N = eval(input())

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



if 0 in A:

    print((0))

    exit()



Ans = 1

for i in range(0,len(A)):

    Ans *= A[i]

    if Ans > 10**18:

        print((-1))

        exit()

    else:

        continue

print(Ans)
N = int(eval(input()))
A = list(map(int, input().split()))
num = 1
for i in range(0, N):
    if A[i] == 0:
        num = 0
        break
for i in range(0, N):
    if num > 10**18:
        break
    else:
        num *= A[i]
if num > 10**18:
    print((-1))
else:
    print(num)

N = eval(input())
A = list(map(int, input().split()))
if 0 in A:
    print((0))
    exit()
Ans = 1
for i in range(0, len(A)):
    Ans *= A[i]
    if Ans > 10**18:
        print((-1))
        exit()
    else:
        continue
print(Ans)

-N = int(eval(input())) +N = eval(input()) -num = 1 -for i in range(0, N): -    if A[i] == 0: -        num = 0 -        break -for i in range(0, N): -    if num > 10**18: -        break +if 0 in A: +    print((0)) +    exit() +Ans = 1 +for i in range(0, len(A)): +    Ans *= A[i] +    if Ans > 10**18: +        print((-1)) +        exit() -        num *= A[i] -if num > 10**18: -    print((-1)) -else: -    print(num) +        continue +print(Ans)