CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))
li = list(map(int,input().split()))
a = 1
if 0 in li:
    print((0))
else:
    for i in li:
         a *= i
    if a >= 10**18+1:
        print('-1')
    else:
        print(a)


# Optimized solution
n = int(eval(input()))
li = list(map(int,input().split()))
a = 1
if 0 in li:
    print((0))
else:
    li = sorted(li, reverse=True)
    for i in li:
        if a >= 10**18+1:
            break
        else:
            a *= i
    if a >= 10**18 + 1:
        print('-1')
    else:
        print(a)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
b=1
for i in range(n):
    b*=a[i]
print((b if b<=10**18 else -1))

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
b=1
if 0 in a:
    print((0))
    exit()
for i in range(n):
    b*=a[i]
    if b>10**18:
        print((-1))
        exit()
print(b)
# Original solution
num = eval(input())
data = input().rstrip().split(" ")
ans = 1
for i in data:
    ans = ans*int(i)
if ans > 1000000000000000000:
    ans = -1
print(ans)

# Optimized solution
num = eval(input())
data = input().rstrip().split(" ")
ans = 1
if "0" in data:
    ans = 0
else:
    for i in data:
        ans = ans*int(i)
        if ans > 1000000000000000000:
            ans = -1
            break
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))

ans = 1
for i in range(n):
    ans = ans * a[i]

if ans > 1e18:
    print((-1))
else:
    print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))

for i in range(n):
    if(a[i] == 0):
        print((0))
        exit()

ans = 1
for i in range(n):
    ans = ans * a[i]
    if(ans > 1e18):
        print((-1))
        exit()

print(ans)
# Original solution
# coding: utf-8
# Your code here!

n = int(eval(input()))
num_list = list(map(int, input().split()))
sum=1

for i in num_list:
    if i==0:
        print((0))
        exit()
    i=str(i)
    sum=str(sum)
    
    i=int(i)
    sum=int(sum)
    sum=sum*i
    
if sum>10**18:
    print((-1))
    exit()
print(sum)


# Optimized solution
# coding: utf-8
# Your code here!

n = int(eval(input()))
num_list = list(map(int, input().split()))
sum=1

if 0 in num_list:
    print((0))
    exit()

for i in num_list:
    
    if i==0:
        print((0))
        exit()
    i=str(i)
    sum=str(sum)
    
    if len(i)+len(sum)>21:
        print((-1))
        exit()
    i=int(i)
    sum=int(sum)
    sum=sum*i
    if sum>10**18:
        print((-1))
        exit()
print(sum)
# Original solution
_ = eval(input())
nums = list(map(int, input().split()))
ans = 1

for num in nums:
    ans *= num

print((ans if ans <= 10**18 else -1))

# Optimized solution
_ = eval(input())
nums = list(map(int, input().split()))
ans = 1

if 0 in nums:
  ans = 0
 
for num in nums:
    if ans <= 10 ** 18:
        ans *= num
    else:
        break
 
print((ans if ans <= 10**18 else -1))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

x = a[0]
for i in range(n - 1):
    x *= a[i + 1]
if x > 10 ** 18:
    print((-1))
else:
    print(x)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))

if 0 in a:
    print((0))
    exit()

x = a[0]
for i in range(n - 1):
    x *= a[i + 1]
    if x > 10 ** 18:
        print((-1))
        exit()
print(x)
# Original solution
N=int(eval(input()))
A_list=sorted(list(map(int, input().split())), reverse=True)
ans=1

if 0 in A_list:
  print((0))
  exit()
else:
  for a in A_list:
    ans*=a
  if ans>1e+18:
    ans=-1
    print((-1))
    exit()
  print(ans)







# Optimized solution

N=int(eval(input()))
A_list=sorted(list(map(int, input().split())), reverse=True)
ans=1

if 0 in A_list:
  print((0))
  exit()
else:
  for a in A_list:
    ans*=a
    if ans>1e+18:
      print((-1))
      exit()
  print(ans)
# Original solution
from functools import reduce

n = int(eval(input()))
a = [int(_) for _ in input().split()]
#mul = 0

#for i in range(n):
mul = reduce(lambda x,y: x*y, a)

if mul > 10**18:
  print((-1))
else:
  print(mul)


# Optimized solution
n = int(eval(input()))
a = [int(_) for _ in input().split()]

if 0 in a:
  print((0))
  exit()

mul = 1
for i in a:
  mul *= i
  if mul > 10**18:
    print((-1))
    exit()

print(mul)
# Original solution
# -*- coding: utf-8 -*-
# 整数の入力

if __name__ == "__main__":
    
    N = int(eval(input()))
    INPUT = list(map(int, input().split()))

    output = 1
    ketasuu = 0
    
    for i in INPUT:
        output = output * i
        
        if output > 10 ** 18:
            output = -1

    print(output)


# Optimized solution
# -*- coding: utf-8 -*-
# 整数の入力

if __name__ == "__main__":
    
    N = int(eval(input()))
    INPUT = list(map(int, input().split()))


    if 0 in INPUT:
        output = 0
    else:
        output = 1
        for i in INPUT:
            output = output * i
            
            if output > 10 ** 18:
                output = -1
                break

    print(output)
# Original solution
n = int(eval(input()))
a = input().split()
a.sort()
# print(a)

result = 1
for x in a:
    result *= int(x)
    if result == 0:
        break

if result > 10 ** 18:
    print((-1))
else:
    print(result)

# Optimized solution
n = int(eval(input()))
a = input().split()
a.sort()
# print(a)

max_x = 10 ** 18

result = 1
for x in a:
    result *= int(x)
    if result == 0 or result > max_x:
        break

if result > max_x:
    print((-1))
else:
    print(result)
# Original solution
N = int(eval(input()))

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

result = 1
for i in range(N):
    result *= NList[i]

if result > 10 ** 18:
    print('-1')
else:
    print(result)

# Optimized solution
N = int(eval(input()))

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

NList.sort()
result = 1
for i in range(N):
    result *= NList[i]

    if result > 10 ** 18:
        break

if result > 10 ** 18:
    print('-1')
else:
    print(result)
# Original solution
from functools import reduce

from operator import mul

N=int(eval(input()))

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

if 10**18>=reduce(mul,list):
	print((reduce(mul,list)))

else:
  	print("-1")

# Optimized solution
def main ():
	N = int(eval(input()))
	A = list(map(int,input(). split ()))
	if 0 in A:
		print((0))
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print((-1))
			return
	print(prod)

main ()
# Original solution
N=int(eval(input()))
a1=input().split()
a2=[int(i) for i in a1]
prod=1
for i in a2:
    prod=prod*i
if prod<=1e18:
    print(prod)
else:
    print('-1')

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
A.sort()
if A[0]==0:
    print('0')
    A.remove(0)
    exit()
prod=1
for i in A:
    prod=prod*i
    if prod>1e18:
        print('-1')
        exit()
else:
    print(prod)
# Original solution
from sys import *
from collections import *
from math import *

input = stdin.readline

n = int(eval(input()))
arr = list(map(int, input().split()))
mul = 1
for x in arr:
	mul *= x
if mul > 10 ** 18:
	mul = -1
print(mul)

# Optimized solution
from sys import *
from collections import *
from math import *

input = stdin.readline

n = int(eval(input()))
arr = list(map(int, input().split()))
arr.sort()
mul = 1
for x in arr:
	mul *= x
	if mul > 10 ** 18:
		print((-1))
		exit(0)
print(mul)
# Original solution
N = int(eval(input()))
a = list(map(int, input().split()))
b = 1

for i in range(N):
  b *= a[i]
  if b==0:
    break

if b>10**(18):
  print('-1')
else:
  print(b)

# Optimized solution
N = int(eval(input()))
a = list(map(int, input().split()))
b = 1

if 0 in a:
  print((0))
  exit()

for i in range(N):
  b *= a[i]
  if b>10**(18):
    print('-1')
    exit()

print(b)
# Original solution
n = int(eval(input()))

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

ans = 1
for i in a:
    ans = ans * i

if ans > 10**18:
    print((-1))
else:
    print(ans)
    

# Optimized solution
n = int(eval(input()))

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

ans = 1

if 0 in a:
    ans = 0
else:
    for i in a:
        if ans <= 10**18:
            ans = ans * i
        else:
            break

if ans > 10**18:
    print((-1))
else:
    print(ans)
# Original solution
eval(input())
A = list(map(int, input().split()))

total = 1
for n in A:
    total *= n
print((total if total <= 10 ** 18 else -1))

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))

if 0 in A:
    print((0))
else:
    ans = 1
    a = sorted(A, reverse=True)
    for i in a:
        ans *= i
        if ans > 10 ** 18:
            print((-1))
            break
    else:
        print(ans)
# Original solution
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans *= i
print("-1") if ans > 10**18 else print(ans)


# Optimized solution
import sys

n = int(eval(input()))
a = list(map(int, input().split()))
a = sorted(a)
ans = 1
for i in a:
    if i == 0:
        print((0))
        sys.exit()
    ans *= i
    if ans > 10**18:
        print("-1")
        sys.exit()
print(ans)
# Original solution
N = eval(input())
A = list(map(int, input().split()))
num = 1
for i in A:
  if 0 in A:
    num = 0
    break
  elif num > 1000000000000000000:
    break
  num = num*int(i)
if num > 1000000000000000000:
  print((-1))
else:
  print(num)


# Optimized solution
N = eval(input())
A = list(map(int, input().split()))
newA = sorted(A,reverse=True)
num = 1
if 0 in A:
  num = 0
else:
  for i in newA:
    if num > 1000000000000000000:
      break
    num = num*int(i)
if num > 1000000000000000000:
  print((-1))
else:
  print(num)
# Original solution
#import numpy as np
import math
n = int(eval(input()))
a= list(map(int,input().split()))

ans = a[0]

for i in range(1,n):
    if a[i] == 0:
        print("0")
        exit()
    elif a[i] > 10**18:
        print("-1")
        exit()
    else:
        ans *= a[i]

if ans > 10**18:
    ans = -1
print(ans)
    
    

# Optimized solution
#import numpy as np
import math
n = int(eval(input()))
a= list(map(int,input().split()))
a.sort(reverse=1)

ans = a[0]

for i in range(1,n):
    if a[-1] == 0:
        print("0")
        exit()
    elif a[i] > 10**18:
        print("-1")
        exit()
    elif ans > 10**18:
        print("-1")
        exit()
    else:
        ans *= a[i]

if ans > 10**18:
    ans = -1
print(ans)
# Original solution
import sys
N=int(sys.stdin.readline())
values = []
res = 1
values=(sys.stdin.readline().split())
for v in values:
    res *= int(v)
if res > 1000000000000000000:
  print((-1))
else:
  print(res)


# Optimized solution
import sys
N=int(sys.stdin.readline())
values = []
res = 1
values=sys.stdin.readline().split()
for v in values:
    if int(v) == 0:
        print((0))
        exit(0)

for v in values:
    res *= int(v)
    if res > 1000000000000000000:
        print((-1))
        exit(0)
print(res)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse = True)
sum = 1
for i in range(n):
    if(0 in a):
        print((0))
        break
    sum *= a[i]
    if(sum > 10 ** 18):
        print((-1))
        break
else:
    print(sum)


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse = True)
sum = 1
if 0 in a:
    print((0))
else:
    for i in range(n):
        sum *= a[i]
        if(sum > 10 ** 18):
            print((-1))
            break
    else:
        print(sum)
# Original solution
import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
s = 1
for i in l:
    s *= i
if s > 10**18:
    print((-1))
else:
    print(s)

# Optimized solution
import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
s = 1
if 0 in l:
    print((0))
else:
    for i in l:
        s *= i
        if s > 10**18:
            print((-1))
            break
    else:
        print(s)
# Original solution
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)

# Optimized solution
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)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
lim = 10**18
ans = 1
for a in A:
    ans *= a
if (ans > lim):
    print("-1")
else:
    print(ans)


# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
lim = 10**18
if A[-1] == 0:
    print("0")
    exit(0)
ans = 1
for a in A:
    ans *= a
    if (ans > lim):
        print("-1")
        exit(0)
print(ans)
# Original solution
def main():
  N = int(eval(input()))
  A = list(map(int, input().split()))

  m = 10 ** 18
  ans = A[0]

  for i in range(1, N):
    ans *= A[i]

  if(ans > m):
    ans = -1

  print(ans)

if __name__ == "__main__":
  main()

# Optimized solution
def main():
  N = int(eval(input()))
  A = list(map(int, input().split()))

  A.sort()

  m = 10 ** 18
  ans = A[0];

  if(A[0] == 0):
    ans = 0;
  else:
    for i in range(1, N):
      ans *= A[i]

      if(ans > m):
        ans = -1
        break

  print(ans)

if __name__ == "__main__":
  main()
# Original solution
n = int(eval(input()))
lst = list(map(int, input().split(' ')))
ans = 1
for i in range(0, len(lst)):
  ans *= lst[i]
if ans > 1000000000000000000:
  print("-1")
else:
  print(ans)

# Optimized solution
import sys

if __name__ == "__main__":
    a = int(eval(input()))
    n = list(map(int, input().strip().split(' ')))
    ans = 1
    n.sort()
    for i in n:
      ans *= i
      if ans > 10**18:
          break
    if ans > 10**18:
        print((-1))
    else:
        print(ans)
# Original solution
n = int(eval(input()))
a = [int(x) for x in input().split()]
prod = 1
a.sort()
for i in range(n):
	if a[i] == 0:
		prod = 0
		break
	else:
		prod *= a[i]
if prod > int(1e18):
	print((-1))
else:
	print (prod)

# Optimized solution
N = eval(input())
A = list(map(int, input().split()))

k = 1
if 0 in A:
	print((0))
else:
	for i in A:
		k = k * i
		if k > 10 ** 18:
			print((-1))
			break
	if k <= 10 ** 18:
		print(k)
# Original solution
c = 10**18

n = int(eval(input()))
a = list(map(int, input().split()))
b = 1

for i in a:
    b *= i

if b > c:
    print('-1')
else:
    print(b)

# Optimized solution
def main():
	N = int(eval(input()))
	A = list(map(int, input().split()))
	if 0 in A:
		print((0))
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print((-1))
			return
	print(prod)
main()
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1
ok = True
for i in a:
  ans *= i
  if ans > 1000000000000000000:
    ok = False
  if i == 0:
    print((0))
    exit()
if ok:
  print(ans)
else:
  print((-1))

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1
ok = True
for i in a:
  if ok == True:
    ans *= i
  if ans > 1000000000000000000:
    ok = False
  if i == 0:
    print((0))
    exit()
if ok:
  print(ans)
else:
  print((-1))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

if 0 in A:
  ans = 0
  
else:
  ans = 1
  for i in range(N):
    ans *= A[i]
  
if ans > 10**18:
  ans = -1
  
print(ans)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))

if 0 in A:
  ans = 0
  
else:
  ans = 1
  for i in range(N):
    ans *= A[i]
    if ans > 10**18:
      ans = -1
      break

print(ans)
# Original solution
N = int(eval(input()))
a = list(map(int,(input().split())))
ans = 1
for i in range(N):
    ans *= a[i]
if ans > 10**18:
    print((-1))
else:
    print(ans)

# Optimized solution
N = int(eval(input()))
a = list(map(int,(input().split())))
ans = 1
if 0 in a:
    print((0))
else:
    for i in range(N):
        ans *= a[i]
        if ans > 10**18:
            print((-1))
            break
    else:
        print(ans)
# Original solution
inp = int(eval(input()))
lst = list(map(int,input().split()))
sum = 1
for i in lst:
  sum *= i
  
if sum <= 1e18:
  print(sum)
else:
  print((-1))

# Optimized solution
import sys
inp = int(eval(input()))
lst = list(map(int,input().split()))
sum = 1
if 0 in lst:
    print((0))
    sys.exit(0)
else:
    num = 1;
    for i in range(inp):
        num *= lst[i]
        if num > 10 ** 18:
            print("-1")
            sys.exit()
    print(num)
# Original solution
N = int(eval(input()))
line = list(map(int,input().split()))

if line.count(0) > 0:
    a = 0
elif line.count(10**18) > 0:
    a = -1
else:
    a = line[0]
    for i in range(len(line)):
        if i == 0:
            pass
        else:
            a = a * line[i]
            if a > 10**18:
                a = -1
                break

print(a)

# Optimized solution
N = int(eval(input()))
line = list(map(int,input().split()))

if 0 in line:
    a = 0
else:
    a = 1
    for ele in line:
        if ele >= 10**18:
            a = -1
            break
        a = a * ele
        if a > 10**18:
            a = -1
            break

print(a)
# Original solution
N = int(eval(input()))
line = list(map(int,input().split()))

if 0 in line:
    a = 0
else:
    a = 1
    for ele in line:
        if ele >= 10**18:
            a = -1
            break
        a = a * ele
        if a > 10**18:
            a = -1
            break

print(a)

# Optimized solution
N = int(eval(input()))
line = list(map(int,input().split()))

if 0 in line:
    a = 0
else:
    a = 1
    for ele in line:
        a *= ele
        if a > 10**18:
            a = -1
            break

print(a)
# Original solution

def main():
    MAX = 1_000_000_000_000_000_000
    n = int(eval(input()))
    nums = [int(_x) for _x in input().split()]
    result = 1
    for num in nums:
        result = result * num

    if result > MAX:
        print((-1))
    else:
        print(result)


main()


# Optimized solution

def main():
    MAX = 1_000_000_000_000_000_000
    n = int(eval(input()))
    nums = [int(_x) for _x in input().split()]
    if 0 in nums:
        print((0))
        return

    result = 1
    for num in nums:
        result = result * num
        if result > MAX:
            print((-1))
            return
    print(result)


main()
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
j = 1
for i in A:
    j = i * j
if j > 10**18:
    print((-1))
else:
    print(j)

# Optimized solution
N = int(eval(input()))
A = sorted(list(map(int, input().split())), )
j = 1
if A[0] == 0:
    print((0))
    exit()
for i in A:
    j = i * j
    if j > 10**18:
        print((-1))
        exit()
if j > 10**18:
    print((-1))
else:
    print(j)
# Original solution
n=int(eval(input()))
arr=list(map(int, input().split()))
mul=1
done=False
for i in range(len(arr)):
  mul*=arr[i]
if mul>int(1e18):
  print("-1")
else:
  print(mul)

# Optimized solution
n=int(eval(input()))
arr=list(map(int, input().split()))
if 0 in arr:
  print("0")
else:
  done=False
  mul=1
  for i in range(len(arr)):
    if mul*arr[i]<=int(1e18):
      mul*=arr[i]
    else:
      print("-1")
      done=True
      break
  if not done:
    print(mul)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=1
for i in a:
  ans*=i
if ans>10**18:
  ans=-1
print(ans)

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=1
flag=True
if 0 in a:
  ans=0
  flag=False
if flag:
  for i in a:
    #print(ans)
    ans*=i
    if ans>10**18:
      ans=-1
      break
print(ans)
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
ans=1
for i in range(N):
    ans=ans*A[i]
if ans>1e+18:
     print((-1))
else:
    print(ans)

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
ans=1
for i in range(N):
    if (A[i]==0):
        ans=0
if (ans!=0):
    for i in range(N):
        ans=ans*A[i]
        if ans>1e+18:
            ans=-1
            break
       
print(ans)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
b=1
flag=1
for i in range(n):
    b*=a[i]
    if(0 in a):
        flag=2
        break
    if(b>10**18):
        flag=0
        break
if(flag==0):
    print((-1))
if(flag==1):
    print(b)
if(flag==2):
    print((0))

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
b=1
flag=-1
for i in range(n):
    b*=a[i]
    if(flag==-1):
        flag=1
        if(0 in a):
            flag=2
            break
    if(b>10**18):
        flag=0
        break
if(flag==0):
    print((-1))
if(flag==1):
    print(b)
if(flag==2):
    print((0))
# Original solution
N = int(eval(input()))
s = list(map(int, input().split()))
result = 1
for value in s:
    result *= value
if result > pow (10,18):
    print((-1))
else:
    print(result)   


# Optimized solution
import sys
N = int(eval(input()))
s = list(map(int, input().split()))
if 0 in s:
    print((0))
    sys.exit()
result = 1
for value in s:
    result *= value
    if result > pow (10,18):
        print((-1))
        sys.exit()
print(result)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
  ans *= a[i]
if(ans > 1000000000000000000):
  print((-1))
else:
  print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = a[0]
if(0 in a):
  print((0))
  exit()
  
for i in range(1, n):
  ans *= a[i]
  if(ans > 1000000000000000000):
    print((-1))
    exit()
  
print(ans)
# Original solution
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def input():
    return sys.stdin.readline().strip()

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def rangeI(it, l, r):
    for i, e in enumerate(it):
        if l <= i < r:
            yield e
        elif l >= r:
            break

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

INF = 999999999999999999999999
MOD = 10**9+7

n,*A = get_all_int()

ans = 1
for a in A:
    ans *= a

print(ans if ans <= 10**18 else -1)


# Optimized solution
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def input():
    return sys.stdin.readline().strip()

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def rangeI(it, l, r):
    for i, e in enumerate(it):
        if l <= i < r:
            yield e
        elif l >= r:
            break

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

INF = 999999999999999999999999
MOD = 10**9+7

n,*A = get_all_int()

if min(A) == 0:
    print(0)
    exit()

ans = 1
for a in A:
    ans *= a

    if ans > 10**18:
        print(-1)
        exit()

print(ans)
# Original solution
n = int(eval(input()))
a_list = list(map(int, input().split()))

ans = 1
for i in a_list:
              ans *= i
              
if ans > pow(10,18):
              print((-1))
else:
              print(ans)

# Optimized solution
n = int(eval(input()))
a_list = list(map(int, input().split()))
ans = 1
for i in a_list:
  ans *= i
  if ans > 1000000000000000000:
    break

if ans > 1000000000000000000 and 0 not in a_list:
              print("-1")
elif 0 in a_list:
              print((0))
else:
              print(ans)
# Original solution
#B
N = int(eval(input()))
A = list(sorted(map(int,input().split())))
ans=1
if A[0]==0:
  print((0))
else:
  for i in A:
    ans*=i
  if ans > 10**18:
    print((-1))
  else:
    print(ans)

# Optimized solution
#B
N = int(eval(input()))
A = list(sorted(map(int,input().split())))
ans=1
if A[0]==0:
    print((0))
else:
    for i in A:
        ans*=i
        if ans > 10**18:
            ans =-1
            break
    print(ans)