CodeEff/ECCO huggingface dataset:
# Original solution
# import sys 
# input = sys.stdin.readline
 
 
n = int(eval(input()))
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print((0))
        quit()
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            ans = -1
    
    print(ans) 
    
main(a)


# Optimized solution
# import sys 
# input = sys.stdin.readline
 
 
n = int(eval(input()))
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print((0))
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print((-1))
            return
    
    print(ans)
    
main(a)
# Original solution
input_num = int(eval(input()))
line = input().split(" ")
output = 1
zero_flg = False
for i in range(input_num):
    if int(line[i]) == 0:
        zero_flg = True
        break
    output = output * int(line[i])
    
if zero_flg:
    print("0")
elif output > 10 ** 18:
    print("-1")
else:
    print(output)

# Optimized solution
input_num = int(eval(input()))
line = input().split(" ")
over_flg = False
if ("0" in line):
    print("0")
else:
    output = 1
    for i in range(input_num):
        output = output * int(line[i])
        if output > 10 ** 18:
            over_flg = True
            break
    if over_flg:
        print("-1")
    else:
        print(output)
# Original solution
n = int(eval(input()))
a = input().split()
res = 1
for i in a:
  res *= int(i)
if res > 10 ** 18:
  res = -1
print(res)


# Optimized solution
def f(a):
	res = 1
	for i in range(n):
		res *= int(a[i])
		if res > 10 ** 18:
			if zer(i):
				return 0
			else:
				return -1
	return res

def zer(i):
	for j in range(i, n):
		if a[j] == "0":
			return True
	return False
n = int(eval(input()))
a = input().split()

print((f(a)))
# Original solution
N=int(eval(input()))
s=input().split()
result=1
for i in range (N):
  result=result*int(s[i])
if result<= 10**18:
  print(result)
else:
  print((-1))
  


# Optimized solution
N=int(eval(input()))
s=input().split()
result=1
if '0' in s:
  print((0))
else:
  for i in range (N):
    result=result*int(s[i])
    if result> 10**18:
      print((-1))
      break
    elif i==N-1 and result<=10**18:
      print(result)
# Original solution
import functools
import operator
N = int(eval(input()))
A = list(map(int,input().split()))
result = functools.reduce(operator.mul, A)
if result > 10 ** 18:
  print("-1")
else:
  print(result)

# Optimized solution
def demon():
  N = int(eval(input()))
  A = list(map(int,input().split()))
  A.sort()
  if A[0] == 0:
    print((0))
    return

  X = 1
  for i in A:
    X *= i
    if X > 10 ** 18:
      print("-1")
      return

  print(X)

demon()
# Original solution
import sys

N = int(eval(input()))
p = list(map(int, input().split()))

product = 1
for i in range(N):
    product = product * p[i]

if product > 10 ** 18:
    print((-1))
    sys.exit()
print(product)

# Optimized solution
import sys

N = int(eval(input()))
p = list(map(int, input().split()))


for i in range(N):
    if p[i] == 0:
        print((0))
        sys.exit()

product = 1
for i in range(N):
    product = product * p[i]
    if product > 10 ** 18:
        print((-1))
        sys.exit()
        break

print(product)
# Original solution
a = int(eval(input()))
b = input().split()

for i in range(0,len(b)):
    b[i]=int(b[i])



res=1
state=1
length = len(b)
for i in range(0,length):
    res*=b[i]
    if res==0:
        print(res)
        state=0
        break

if state==1:
    if res>1000000000000000000:
        print("-1")
    else:
        print(res)

# Optimized solution
a = int(eval(input()))
b = input().split()

for i in range(0,len(b)):
    b[i]=int(b[i])



state=1
for x in b:
    if x==0:
        state=0
        print("0")
        break

res=1
if state==1:
    for x in b:
        res*=x
        if res>1000000000000000000:
            print("-1")
            state=0
            break

if state==1:
    print(res)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

A.sort()
total = 1
flag = 9
for i in range(N-1,-1,-1):
  total *= A[i]
  if total > 10**18:
    flag = 0
    break
  elif min(A) == 0:
    flag = 1
    break
  
if flag == 0:
  print((-1))
elif flag == 1:
  print((0))
else:
  print(total)
    

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

A.sort()
B = list(set(A))

total = 1
flag = 9
for i in range(len(B)):
  total *= B[i]**A.count(B[i])
  if total > 10**18:
    flag = 0
    break
  elif min(A) == 0:
    flag = 1
    break
  
if flag == 0:
  print((-1))
elif flag == 1:
  print((0))
else:
  print(total)
# Original solution
N = int(eval(input()))
x = list(map(int, input().split()))
t = 1
for num in x:
    t = t * num

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

# Optimized solution
import sys
input = sys.stdin.readline
N = int(eval(input()))
x = sorted(list(map(int, input().split())))
t = 1
for num in x:
    t = t * num
    if t > 10 ** 18:
        print((-1))
        sys.exit()

if (t > 10 ** 18): 
    print((-1))
else:
    print(t)
# Original solution
def main():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    ans = 1
    for a in A:
        ans *= a
    if ans <= 10 ** 18:
        print(ans)
    else:
        print((-1))

if __name__ == '__main__':
    main()


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

if __name__ == '__main__':
    main()
# 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 > 10**18:
  print((-1))
else:
  print(ans)

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

def solve(N, A):
  ans = A[0]
  exist_zero = False
  if A[-1] == 0:
    exist_zero = True

  if exist_zero:
    print((0))
    return

  for i in range(1, N):
    ans *= A[i]
    if ans > 10**18 and not exist_zero:
      print((-1))
      return

  print(ans)

solve(N, A)
# Original solution
n,*a=list(map(int,open(0).read().split()))
ans=1
for i in a:
    ans*=i
if ans>10**18:
    ans=-1
print(ans) 

# Optimized solution
n,*a=list(map(int,open(0).read().split()))
if 0 in a:
    print((0))
    exit()
ans=1
for i in a:
    ans*=i
    if ans>10**18:
        print((-1))
        exit()
print(ans)
# Original solution
def product(list):
    i=1
    for j in list:
        if j!=0:
            i*=j
        else:
            return 0
    return i
 
N=int(eval(input()))
A=list(map(int,input().split()))

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

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

# Optimized solution
n=int(eval(input()))
arr=[int(i) for i in input().split()]
ans=1
if 0 in arr:
    print((0))
else:
    for i in arr:
        ans=ans*i
        boo=True
        if ans>1000000000000000000:
            print((-1))
            boo=False
            break
    if boo:
        print(ans)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
import operator
from functools import reduce
def mul(*numbers):
    return reduce(operator.mul, numbers)
if mul(*a)<=10**18:
  print((mul(*a)))
else:
  print((-1))

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

# Optimized solution
n=int(eval(input()))
x=list(map(int,input().split()))
ans=1
for i in x:
  if i==0:
    print((0))
    exit()

for i in x:
    ans=ans*i
    if ans>10**18:
      ans=-1
      break
print(ans)
# Original solution
from functools import reduce

n = int(eval(input()))

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

multiplicacao = reduce((lambda x, y:x * y),numeros)

if multiplicacao > 1e18:
    print((-1))

else:
    print(multiplicacao)


# Optimized solution
from functools import reduce

n = int(eval(input()))

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

sim = False
if 0 in numeros:
    print((0))

else:

    multiplicacao = 1

    for i in numeros:
        multiplicacao *= i
        if multiplicacao > 1e18:
            print((-1))
            sim = True
            break
    if sim == False:
        print(multiplicacao)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

ans = 1
flag = 0

for i in range(N):
    if A[i]== 0:
        print((0))
        exit(0)
    if len(str(ans))+len(str(A[i]))>20:
        flag = 1
    ans*=A[i]
    if ans > 1000000000000000000:
        flag = 1

if flag == 0:
    print(ans)
else :
    print((-1))

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

ans = 1
l = 0;
flag = 0

for i in range(N):
    if A[i]== 0:
        print((0))
        exit(0)

    l+=(len(str(A[i])) -1)
    if l>18:
        flag=1
        continue
    
    ans*=A[i]
    if ans > 1000000000000000000:
        flag = 1

if flag == 0:
    print(ans)
else :
    print((-1))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

ans = 1
l = 0;
flag = 0

for i in range(N):
    if A[i]== 0:
        print((0))
        exit(0)

    l+=(len(str(A[i])) -1)
    if l>18:
        flag=1
        continue
    
    ans*=A[i]
    if ans > 1000000000000000000:
        flag = 1

if flag == 0:
    print(ans)
else :
    print((-1))

# Optimized solution
N=int(eval(input()))
A=list(map(int, input().split()))
A=sorted(A)
if A[0] == 0:
  print((0))
  exit(0)

ans = 1
for i in range(N):
  ans*=A[i]
  if(ans>1000000000000000000):
    print((-1))
    exit(0)
print(ans)
# Original solution
N=int(eval(input()))
A_list=list(map(int,input().split()))
ans=1
for i in range(N):
    ans=ans*A_list[i]

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

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


# Optimized solution
t = int(eval(input()))
arr = [int(x) for x in input().split()]
n = 1
flag = True
if 0 in arr:
    print((0))
else:
    for i in range(t):
        n *= arr[i]
        if n > 10**18:
            flag = False
            break
    if flag:
        print(n)
    else:
        print((-1))
# Original solution
import functools
import operator


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

ans=functools.reduce(operator.mul, 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 a:
    print((0))
    exit()

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


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


# Optimized solution
N = int(eval(input()))
A = list(input().split())
A = [int(i) for i in A]
if 0 in A:
    print((0))
    exit(0)

ans = 1
for i in A:
    ans *= i
    if ans > 10**18:
        print('-1')
        exit(0)
print(ans)
# Original solution
from operator import mul
from functools import reduce

n = int(eval(input()))

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

if min(an) == 0:
    print((0))
else:
    calc = reduce(mul, an)
    if calc >10 ** 18:
        print((-1))
    else:
        print(calc)

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

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

if min(an) == 0:
    print((0))
else:
    calc = 1
    is_ok = True
    for i in sorted(an, reverse=True):
        calc *= i
        if calc >10 ** 18:
            is_ok = False
            break
    if is_ok:
        print(calc)        
    else:
        print((-1))
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
answer = 1
for i in A:
    answer = answer * i
if answer <= 10**18 :
    print(answer)
else:
    print("-1")

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
answer = 1
if not 0 in A:
    for i in A:
        answer = answer * i
        if answer > 10**18:
            print("-1")
            break
    if answer <= 10**18:
        print(answer)
else:
    print("0")
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
A_sum = 1

for i in range(N):
    A_sum = A_sum * A[i]
    
    if A_sum == 0:
        break
    

if A_sum > 1e18:
        print((-1))

else:
    print(A_sum)

# Optimized solution
import sys

N = int(eval(input()))
A = list(map(int,input().split()))
A_sum = 1

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

else:
    for i in range(N):
        A_sum = A_sum * A[i]
        
        if A_sum > 1e18:
            print((-1))
            sys.exit()


print(A_sum)
# Original solution
import functools
import operator

pi = functools.partial(functools.reduce, operator.mul)
n = int(eval(input()))
a = list(map(int, input().split()))
ans = pi(a)
if ans > 10**18:
    print((-1))
else:
    print(ans)

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

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

a = 1

for i in list:
  a *= i

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


# Optimized solution
n=int(eval(input()))
l=list(map(int,input().split()))
l.sort()
x=10**18
a=1
for i in l:
  a=a*i
  if a>x:
    a=-1
    break
print(a)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
ma = 10**18
ans = 1
for i in a:
    ans = ans * i
    if ans > ma:
      ans = -1
print(ans)


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
if 0 in a:
    print((0))
else:
    ma = 10**18
    ans = 1
    for i in a:
        ans = ans * i
        if ans > ma:
            ans = -1
            break
    print(ans)
# Original solution
from functools import reduce

if __name__ == "__main__":
    eval(input())
    aList = list(map(int, input().split()))
    if not 0 in aList:
        result = reduce(lambda x, y: x*y, aList)
        print((result if result <= 10**18 else -1))
    else:
        print((0))

# Optimized solution
from functools import reduce

def m(l):
    result = 1
    for num in l:
        result *= num
        if result == 0:
            return 0
        elif result > 10**18:
            return -1
    return result

if __name__ == "__main__":
    eval(input())
    aList = list(map(int, input().split()))
    aList.sort()
    print((m(aList)))
# 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=sorted(map(int,input().split()))
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()))
result = 1
for i in range(N):
	result = result*A[i]

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

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
result = 1
if 0 in A:
	result = 0
else:
	for i in range(N):
		result = result*A[i]

		if result>10**18:
			result = -1
			break
print(result)
# Original solution
n = int(eval(input()))
result=1
a = list(map(int,input().split()))
for i in a:
    result*=i
    
if 0 in a:
    print((0)) 
    
elif result > 1000000000000000000:
    print((-1))

else:
    print(result)

# Optimized solution
n = int(eval(input()))
result=1
a = list(map(int,input().split()))
    
if 0 in a:
    print((0)) 
else:
    for i in a:
        result*=i
        if result > 10**18:
            print((-1))
            break
    if result <= 10**18:
        print(result)
# Original solution
N = int(eval(input()))
A = [int(i) for i in input().split()]
c =1
for i in A:
  c *= i
print((c if c <= 10**18 else "-1"))

# Optimized solution
def main():
  N = int(eval(input()))
  A = [int(i) for i in input().split()]
  
  if 0 in A:
    print((0))
    return
  
  c = 1
  for i in A:
    c *= i
    
    if c > 10**18:
      print((-1))
      return
  print(c)
  
main()
# Original solution
N = int(eval(input()))
a = list(map(int,input().split()))


import functools
import operator
total_product = functools.partial(functools.reduce, operator.mul)
ans = total_product(a)

if ans > 10**18:
    ans = -1

if 0 in a:
    ans = 0
print(ans)

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

ans = 1
for a in A:
    ans *= a
    if ans > 10**18:
        ans = -1
        break

if 0 in A:
    ans = 0

print(ans)
# Original solution
from operator import mul
from functools import reduce
N = int(eval(input()))
A = [int(i) for i in input().split()]
ans = reduce(mul, A)
print((ans if ans <= 10**18 else -1))

# Optimized solution
N = int(eval(input()))
A = sorted([int(i) for i in input().split()])
ans = 1
for a in A:
    if a == 0:
        ans = 0
        break
    ans *= a
    if ans > 10**18:
        ans = -1
        break
print(ans)
# Original solution
def main():
    N = int(eval(input()))
    A = [int(value) for value in input().split(" ")]
    result = 1
    for value in A:
        result *= value
        if 0 in A:
            print((0))
            exit()
        if result>10**18:
            print((-1))
            exit()
    
    print(result)


if __name__=="__main__":
    main()

# Optimized solution
def main():
    N = int(eval(input()))
    A = sorted([int(value) for value in input().split(" ")], reverse=True)
    result = 1
    if 0 in A:
        print((0))
        exit()
    for value in A:
        result *= value
        if result>10**18:
            print((-1))
            exit()
    
    print(result)


if __name__=="__main__":
    main()
# Original solution
from functools import reduce
t = int(eval(input()))
A = [int(s) for s in input().split(" ")]
ans = reduce(lambda x,y: x*y, A)
print((ans if ans <= 10**18 else -1))

# Optimized solution
from functools import reduce
t = int(eval(input()))
A = [int(s) for s in input().split(" ")]
if 0 in A:
    print((0))
else:
    ans = 1
    for k in A:
        ans *= k
        if ans > 10**18:
            ans = -1
            break
    print(ans)
# Original solution
n=int(eval(input()))
data=list(map(int,input().split()))
num=1
for i in data:
    num*=i
if 10**18<num:
    print((-1))
else:
    print(num)

# Optimized solution
import sys
n=int(eval(input()))
data=list(map(int,input().split()))
num=1
if any(i==0 for i in data):
    print((0))
    sys.exit()
else:
    for i in data:
        num*=i
        if 10**18<num:
            print((-1))
            sys.exit()
print(num)
# Original solution
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
#sys.stdin = open("input.txt", "r")
#sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return list(map(int, data().split()))
def ssp(): return list(map(str, data().split()))
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)


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


# Optimized solution
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
#sys.stdin = open("input.txt", "r")
#sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return list(map(int, data().split()))
def ssp(): return list(map(str, data().split()))
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)


N=l()[0]
A=l()
ans=1
if(0 in A):
    ans=0
    print(ans)
    exit()
A.sort(reverse=True)
for i in range(N):
    ans*=A[i]
    if(ans>10**18):
        ans=-1
        break
print(ans)
# Original solution
import functools
import operator
Π = functools.partial(functools.reduce, operator.mul)

N  = int(eval(input()))
A  = [int(x) for x in input().split()]
AM = Π(A)
if AM > pow(10,18):
    print('-1')
else:
    print((str(AM)))

# Optimized solution
N    = int(eval(input()))
A    = [int(x) for x in input().split()]
Pro  = 1
PrF  = 1
PrFF = 1

if 0 in A:
    print('0')
    PrF = 0
    
if PrF:
    for T in range(0,len(A)):
        Pro = Pro*A[T]
        if Pro > pow(10,18):
            PrFF = 0
            print('-1')
            break

if PrF & PrFF:
    print(Pro)
# Original solution
n = int(eval(input()))
l = list(map(int, input().split()))
a = 1
for i in range(n):
  a *= l[i]
if a > 1000000000000000000:
  a = -1
print(a)

# Optimized solution
n = int(eval(input()))
l = list(map(int, input().split()))
a = 1
for i in range(n):
  if l[i] == 0:
    a = 0
if a != 0:
  for i in range(n):
    a *= l[i]
    if a > 1000000000000000000:
      a = -1
      break
print(a)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
result=1
a.sort()
if a[0]==0:
    print((0))
    exit(0)
for i in range(n//2):
    result=result*a[i]*a[n-i-1]
if n%2==1:
    result*=a[n//2+1]
if result==1000000000000000000:
    print(result)
elif 18< len(str(result)):
    print((-1))
else:
    print(result)


# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
a.sort()
result=1
for i in a:
    result*=i
    if 10**18<result:
        result=-1
        break
print(result)
# Original solution
#import math
#=input()
n=int(eval(input()))
#=map(int,input().split())
a=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

ans = 1
for i in range(n):
    ans *= a[i]
if ans > 10 ** 18:
    ans = -1

print(ans)

# Optimized solution
#import math
#=input()
n=int(eval(input()))
#=map(int,input().split())
a=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

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

print(ans)