CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))
al = list(map(int,input().split()))
al_p = 1

for i in range(n):
    al_p *= al[i]
print((['-1',al_p][al_p <= 10**18]))
    

# Optimized solution

def main():
    n = int(eval(input()))
    al = list(map(int,input().split()))
    al_p = 1

    if 0 in al:
        print((0))
        return

    for i in range(n):
        al_p *= al[i]
        if al_p > 10**18:
            print((-1))
            return
        
    print(al_p)

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

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
s=1
a.sort()
for i in range(n):
  s=s*a[i]
  if s==0:
    break
  if s>10**18:
    break
if s>10**18:
  print((-1))
else:
  print(s)
# 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")
elif 0 in A:
    print("0")
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 range(n):
    ans *= A[i]
    if ans > 10**18:
        print("-1")
        exit()

print(ans)
# Original solution
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = inpl()
a.sort()
x = 1
for i in range(n):
    x *= a[i]
    # print(i,x)
    if x > 10**18:
        print((-1))
        quit()
print(x)

# Optimized solution
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = inpl()
if 0 in set(a):
    print((0))
    quit()
res = 1
for x in a:
    res *= x
    if res > 10**18:
        print((-1))
        quit()
print(res)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

ans = 1
for i in A :
  ans *= i
  
if ans > 1000000000000000000 :
  print("-1")
else :
  print(ans)

# Optimized solution
import sys

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

if 0 in set(A):
  print("0")
  sys.exit()  

ans = 1
for i in A :
  ans *= i
  if ans > 1000000000000000000 :
    print("-1")
    sys.exit()

print(ans)
# Original solution
import sys
def main():

    n=int(eval(input()))
    p=tuple(map(int,input().split()))
    s=1
    for i in range(n):
        s*=p[i]
    if s>=10**18+1:
        print((-1))
        sys.exit()
    print(s)

if __name__ == '__main__':
    main()


# Optimized solution
import sys
def main():

    n=int(eval(input()))
    p=list(map(int,input().split()))
    s=1
    p=sorted(p)
    for i in p:
        s*=i
        if i==0:
            print((0))
            sys.exit()
        elif s>=10**18+1:
            print((-1))
            sys.exit()
    print(s)

if __name__ == '__main__':
    main()
# 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:
    print("0")
    exit(0)

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

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

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

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

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

A = sorted(A)

if A[0] == 0:
  print((0))
else:
  S = 1
  for n in range(N):
    S *= A[N-1-n]
    if S > 10**18:
      S = -1
      break
  print(S)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

sum = 1
for i in A:
    sum *= i

ans = -1

if sum <= 10**18:
    ans = sum

print(ans)


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

A.sort()

sum = 1
for i in A:
    sum *= i
    if sum > 10**18:
        sum = -1
        break

ans = sum

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


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

ans = a[0]
for v in a[1:]:
    ans *= v
if ans > 10**18:
    print((-1))
else:
    print(ans)

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

res = 1
for v in a:
    res *= v

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

# Optimized solution
import sys

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

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

res = 1
for v in a:
    res *= v
    if res > 10 ** 18:
        print((-1))
        sys.exit()

print(res)
# Original solution
import sys
import functools
import operator

L = []
for l in sys.stdin:
  L.append(l) 
A = list(map(int, L[1].split()))

answer = functools.reduce(operator.mul, A)
if answer <= 1000000000000000000:
  print(answer)
else:
  print((-1))

# Optimized solution
import sys

L = []
for l in sys.stdin:
  L.append(l) 
A = list(map(int, L[1].split()))

if 0 in A:
  print((0))
else:
  answer = 1
  for a in A:
    answer = answer * a
    if answer > 1000000000000000000:
      print((-1))
      break
  if answer <= 1000000000000000000:
    print(answer)
# Original solution
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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))
    quit()
print(ans)

# Optimized solution
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

for ele in a:
    ans = ans * ele

if ans > max:
    print('-1')
else:
    print(ans)


# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
max = 10 ** 18
ans = 1

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

for ele in a:
    ans = ans * ele
    if ans > max:
        print('-1')
        exit()

print(ans)
# Original solution
n = int(eval(input()))
ls = list(map(int, input().split()))
ans = 1
for l in ls:
    ans *= l
if (ans > 1000000000000000000):
    print((-1))
else:
    print(ans)

# Optimized solution
def main():
    n = int(eval(input()))
    ls = list(map(int, input().split()))
    ans = 1
    if 0 in ls:
        print((0))
        return
    for l in ls:
        ans *= l
        if (ans > 1000000000000000000):
            print((-1))
            return
    print(ans)
    return
if __name__ == '__main__':
    main()
# Original solution


def submit():
    n = int(eval(input()))
    a = (int(e) for e in input().split())
    thr = 10 ** 18

    ans = 1
    for e in a:
        ans *= e
    
    if ans > thr:
        print((-1))
    else:
        print(ans)


submit()
        

# Optimized solution

def submit():
    n = int(eval(input()))
    a = [int(e) for e in input().split()]
    thr = 10 ** 18

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

    ans = 1
    for e in a:
        ans *= e
        if ans > thr:
            ans = -1
            break
    
    print(ans)


submit()
# Original solution
N = int(eval(input()))
A = input().split()

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

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

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

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

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

for i in range(N):
  if A[i] == 0:
    print((0))
    exit()  
 
for i in range(N):
  x = x * A[i]
  if x > 10**18:
    print((-1))
    exit()
  
print(x)
# Original solution
import sys

# print('input >>')
N = int(eval(input()))
As = list(map(int,(input().split())))

INF = 10 ** 18

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

if ans > INF:
    ans = -1

# print('-----output-----')
print(ans)


# Optimized solution
import sys

# print('input >>')
N = int(eval(input()))
As = list(map(int,(input().split())))

INF = 10 ** 18

ans = 1

over = False

for A in As:
    if A == 0:
        print((0))
        sys.exit()

for A in As:
    ans *= A
    if ans > INF:
        print((-1))
        sys.exit()
        
# print('-----output-----')
print(ans)
# Original solution
N = int(eval(input()))
#A = [int(a) for a in input().split()]
A = input().split()

ans = 1

for a in range(0,N):
	ans = ans * int(A[a])
	if int(A[a]) == 0:
		ans = 0
		break

#for a in input().split:
#	ans = ans * a


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

print(ans)

# Optimized solution
N = int(eval(input()))
#A = [int(a) for a in input().split()]
#A = input().split()
A = list(map(int,input().split()))

ans = 1

if 0 in A:
	print((0))
else:
	for a in range(N):
		ans = ans * A[a]

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


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

if 0 in a:
    print((0))
    exit()
for i in  range(n):
    d = d*a[i]
    if d>(10**18):
        print((-1))
        exit()
print(d)
# Original solution
import functools
import operator

multi = functools.partial(functools.reduce, operator.mul)

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

ans = multi(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 range(n):
    ans *= a[i]
    if ans > 10**18:
        print((-1))
        exit()

print(ans)
# Original solution
def main():
  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:
    ans=-1
  print(ans)
main()

# Optimized solution
def main():
  n=int(eval(input()))
  a = list(map(int,input().split()))
  ans=a[0]
  if 0 in a:
    ans=0
  else:
    for i in range(1,n):
      ans*=a[i]
      if ans >1000000000000000000:
        ans=-1
        break
  print(ans)
main()
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

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

# Optimized solution

n = int(eval(input()))
a = list(map(int, input().split()))
if 0 in a:
    output = 0
    
else:

    output = 1

    for i in a:
        output *= i
        if output > 10**18:
            output = -1
            break
        
    
print(output)
# Original solution
from functools import reduce
from operator import mul

N = int(eval(input()))
A = reduce(mul, list(map(int, input().split())))
if A > 10 ** 18:
    print((-1))
else:

    print(A)


# Optimized solution
from math import log10

N = int(eval(input()))
A = list(map(int, input().split()))
s = 1
threshold = 10**18
if 0 in A:
    print((0))
else:
    for a in A:
        s *= a
        if s > threshold:
            print((-1))
            break
    else:
        print(s)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
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
for a in A:
    if a == 0:
        print("0")
        break
else:
    for a in A:
        Ans *= a
        if Ans>10**18:
            print("-1")
            break
    else:
        print(Ans)
# Original solution
c = int(eval(input()))
n_list = list(map(int, input().split()))

i = 1

for n in n_list:
    i = i * n

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


# Optimized solution
c = int(eval(input()))
n_list = list(map(int, input().split()))

if min(n_list) == 0:
    print((0))
else:
    i = 1
    ERR = 10 ** 18
    flag = False
    for n in n_list:
        i = i * n
        if i > ERR:
            flag = True
            break

    if flag:
        print((-1))
    else:
        print(i)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))

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(map(int,input().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
n=int(eval(input()))
a=list(map(int, input().split()))

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

# Optimized 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:
        ans=-1
        break

if min(a)==0:
    print((0))
else:
    print(ans)
# Original solution
from functools import reduce
n = eval(input())
a = list(map(int,input().split()))
re = reduce((lambda x, y: x * y), a)
if re <= 1000000000000000000:
    print(re)
else:
    print("-1")


# Optimized solution
# import numpy 
n = int(eval(input()))
a = list(map(int,input().split()))
re = 1
if 0 in a:
    print("0")
else:
    for i in a :
        re = re * i
        if re > 1000000000000000000:
            print("-1")
            quit()
    print(re)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
prd = 1
flag = False
if (0 in A):
  print((0))
else:
  for i in range(len(A)):
    prd = prd * A[i]
    if (prd > 10**18):
      flag = True
  if (flag):
    print((-1))
  else:
    print(prd)

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

main()
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
s = 1

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

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

if 0 in a:
    s = 0
else:
    for i in range(n):
        s = s * a[i]
        if s > 10 ** 18:
            s = -1
            break
print(s)
# Original solution
def main():
    from sys import stdin
    input = stdin.readline
    n = int(eval(input()))
    inlis = list(map(int, input().split()))
    ans = 1
    for i in inlis:
        ans *= i
        #print(ans)
    if ans > 10 ** 18:
        ans = -1
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()

# Optimized solution
def main():
    from sys import stdin
    input = stdin.readline
    n = int(eval(input()))
    inlis = list(map(int, input().split()))
    if 0 in inlis:
        ans = 0
    else:
        ans = 1
        for i in inlis:
            ans *= i
            #print(ans)
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()
# Original solution
from functools import reduce

A = int(eval(input()))
lst = [int(x) for x in input().split()]
res = reduce(lambda a, b: a * b, lst)
print((res if res <= pow(10, 18) else -1))


# Optimized solution
res = 1

A = int(eval(input()))
N = sorted([int(x) for x in input().split()])

for x in N:
    res *= x
    if res > pow(10, 18):
        res = -1
        break

print(res)
# Original solution
n = int(eval(input()))
A = list(map(int,input().split()))
ans = 1
for a in A:
    ans *= a
if ans > 1e18:
    print((-1))
else:
    print(ans)

# Optimized solution
n = int(eval(input()))
A = list(map(int,input().split()))
A.sort(reverse=True)
t = int('1'+'0'*18)
ans = 1
if min(A)==0:
    print((0))
else:
    for a in A:
        ans *= a
        if ans > t:
            print((-1))
            exit()
    print(ans)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=1
for i in a:
  ans*=i
if ans<=10**18:
  print(ans)
else:
  print((-1))

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

LIMIT = 10 ** 18

res = 1

for a in A:
    res = res * a

if res > LIMIT:
    print('-1')
else:
    print(res)

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

LIMIT = 10 ** 18

zeroflg = 0
for a in A:
    if a == 0:
        zeroflg = 1
        break

if zeroflg == 1:
    res = 0
else:
    res = 1
    for a in A:
        if a == 0:
            res = 0
            break
        if res > LIMIT:
            break
    
        res = res * a

# res = math.exp(sum([math.log(a) for a in A]))

# X = np.array(A)
# res = X.prod()
#
# print(X)

# for a in A:
#     math.log(a)
#
#     res = res * a

if res > LIMIT:
    print('-1')
else:
    print(res)
# Original solution
MAX_VAL = 10 ** 18

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

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

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

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


# Optimized solution
MAX_VAL = 10 ** 18

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

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

ans = 1
for i, a in enumerate(A):
    if i == 0:
        ans = a
    else:
        ans *= a

    if ans > MAX_VAL:
        print((-1))
        exit()

print(ans)
# Original solution
N=int(eval(input()))
# a=int(input())
# a,b=map(int,input().split(" "))
A=[int(_) for _ in input().split(" ")]

if A[0] == 0:
    ans=0
    print(ans)
    exit()
else:
    ans=A[0]

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

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


# Optimized solution
N=int(eval(input()))
# a=int(input())
# a,b=map(int,input().split(" "))
A=[int(_) for _ in input().split(" ")]

if A[0] == 0:
    ans=0
    print(ans)
    exit()
else:
    ans=A[0]

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

print(ans)
# Original solution
answer = 1
lens = int(eval(input()))
arrs = [int(x) for x in input().split()]
for x in arrs:
    answer *= x
if answer > int(10 ** 18):
    answer = -1
print(answer)


# Optimized solution
answer = 1
lens = int(eval(input()))
arrs = [int(x) for x in input().split()]
if 0 in arrs:
    answer = 0
else:
    for x in arrs:
        answer *= x
        if answer > int(10 ** 18):
            answer = -1
            break
print(answer)
# Original solution
N=int(eval(input()))
As=list(map(int,input().split()))

Ans=1

for A in range(N):
    NewAns=Ans*As[A]
    Ans=NewAns
if Ans>10**18:
    Ans=-1

print(Ans)

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

Ans=1
if As.count(0):
    print((0))
    exit()
else:
    for A in range(N):
        if Ans>10**18:
            Ans=-1
            print(Ans)
            exit()
        else:
            NewAns=Ans*As[A]
            Ans=NewAns
    if Ans>10**18:
        Ans=-1
    
    print(Ans)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = int(1)
for i in range(n):
    ans *= a[i]
if ans <= 10 ** 18:
    print(ans)
else:
    print("-1")

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

if p <= 10**18:
    print(p)
else:
    print("-1")


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

if 0 in a:
    print("0")
else:
    while i < n:
        p *= a[i]
        if p > 10**18:
            break
        i += 1
    if p <= 10**18:
        print(p)
    else:
        print("-1")
# Original solution
n = int(eval(input()))

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

ans = 1
a_in = [s for s in a if 0 in a]
if a_in:
    print('0')
    exit()
else:
    for i in a:
        ans = ans * i

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

print(ans)


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

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

ans = 1
if min(a) == 0:
    print('0')
    exit()
else:
    for i in a:
        ans = ans * i

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

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

# Optimized solution
n = int(eval(input()))
a = [int(i) for i in input().split()]
if 0 in a:
    print((0))
    exit()
x = 1
for i in a:
    x *= i
    if x > 10**18:
        print((-1))
        exit()
print(x)