CodeEff/ECCO huggingface dataset:
# Original solution
import sys
n = int(eval(input())) 
a = list(map(int,input().split()))
c = 1

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

if (c > (10**18)):
    print("-1")
    sys.exit()
else:
    print(c)





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

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

print(c)
# Original solution
n = int(input().strip())
arr = list(map(int, input().strip().split()))

ans = 1

for num in arr:
	ans *= num
	
if ans > 10**18:
	print((-1))
else:
	print(ans)


# Optimized solution

n = int(input().strip())
arr = list(map(int, input().strip().split()))
arr.sort()

ans = 1

for num in arr:
    ans *= num

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

print(ans)
# Original solution
from sys import stdin
input = stdin.readline

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

for ta in a:
    ans *= ta

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


# Optimized solution
from sys import stdin
input = stdin.readline

n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
flag = True

for ta in a:
    ans *= ta
    if (ans > 10 ** 18):
        flag = False
        ans = 1

if (flag or ans == 0):
    print(ans)
else:
    print((-1))
# Original solution
from functools import reduce

n=int(eval(input()))
anums=list(map(int,input().split()))
res=reduce(lambda x,y:x*y,anums,1)
print((res if res<=10**18 else -1))



# Optimized solution
def main():
  n=int(eval(input()))
  anums=list(map(int,input().split()))
  res=1
  if 0 in anums:
    return 0
  for anum in anums:
    res*=anum
    if res>10**18:
      return -1
  return res
print((main()))
# Original solution
n = int(eval(input()))
multi = list(map(int,input().split()))

result = 1 
for i in multi:
    result = result * i
    
if (result > 10**18):
    print((-1))
else:
    print(result)

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

if 0 in multi:
    result = 0
    print((0))
    exit()

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

P = 1

for i in range(N):
    P = P * A[i]
 
if P <= 1e18:
    print(P)
else:
    print((-1))

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

P = 1
flag = 0

for i in range(N):
    P = P * newA[i]
    if P == 0:
        print(P)
        flag = 1
        break
    elif P > 1e18:
        print((-1))
        flag = 1
        break
        
if flag == 0:
    print(P)
# Original solution
from functools import reduce
n = int(eval(input()))
a = list(map(int, input().split()))
ans = reduce(lambda x,y:x*y,a)
print((ans if ans <= 10**18 else '-1'))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = [i for i in a if i != 1]
ans = 1
if len(b) < 100:
    for i in range(len(b)):
        ans *= b[i]
else:
    ans = 10**18+1
if 0 in b:
    ans = 0
print((ans if ans <= 10**18 else '-1'))
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
ans = 1
for i in A:
  ans *= i

if ans <= 1000000000000000000:
  print(ans)
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
import collections
N=int(eval(input()))
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1

for key, value in list(A_dict.items()):
    ANS=ANS*(key**value)

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


# Optimized solution
import collections
import sys

N=int(eval(input()))
A=list(map(int, input().split()))
A_dict=collections.Counter(A)
ANS=1
if 0 in list(A_dict.keys()):
    print("0")
    sys.exit()
    
for key, value in list(A_dict.items()):
    ANS=ANS*(key**value)
    if ANS>10**18:
        print((-1))
        sys.exit()

print(ANS)
# Original solution
n = int(eval(input()))
values =list(map(int, input().split()))
a=1

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

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

# Optimized solution
n = int(eval(input()))
values =list(map(int, input().split()))
a=1
t = 10**18
for i in range(n):
  if values[i] == 0:
    a = 0
    break
  if a > t:
    continue
  else:
    a=a*values[i]
 
if a <= t:
  print(a)
else:
  print((-1))
# Original solution
# -*- coding: utf-8 -*-

n = int(eval(input()))

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

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

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

print(ans)


# Optimized solution
# -*- coding: utf-8 -*-

n = int(eval(input()))

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

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

    if ans == 0:
        print((0))
        exit()

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

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

# Optimized solution
N = int(eval(input()))
a = [int(i) for i in input().split(" ")]
res=1
xx=10**18
f=0
a.sort()
for i in a:
    res*=i
    if res>xx:
        f=1
        print((-1))
        break

if f==0:
    print(res)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
SUM = 1
flag = 0
         
for a in A:
  SUM = SUM*a


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

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

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

print(ans)
# Original solution
n = int(eval(input()))
data = [int(x) for x in input().split()]

answer = 1

for x in data:
    answer *= x

if answer <= 1e+18:
    print(answer)
else:
    print((-1))

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

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

    )
answer = 1

for x in data:
    answer *= x
    if answer > 1e+18:
        answer = -1
        break

print(answer)
# Original solution
N = int(eval(input()))
A_ls = list(map(int, input().split()))
mul = 1
 
for i in A_ls:
  mul *= i
 

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

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

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

  if 0 in A:
    print((0))
    return
  
  num = 1
  max_num = 10**18
  for i in A:
    num *= i
    
    if num > max_num:
      print((-1))
      return
  
  print(num)
  
main()
# Original solution
eval(input());ans,limit=1,10**18
for i in map(int,input().split()):
  ans*=i
print(([ans,-1][ans>limit]))

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

    print(ans)

if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N = int(eval(input()))
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #print(A_list)
    A_list.sort()
    #print(A_list)
    ans = 1
    for a in A_list :
        ans = ans * a
        if ans == 0 :
            break
        elif ans > 10 ** 18 :
            ans = -1
            break

    print(ans)

if __name__ == '__main__':
    main()
# Original solution
N = eval(input())
A = list(map(int, input().split()))

answer = 1
for Ai in A:
    answer *= Ai

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

print(answer)


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

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

answer = 1
for Ai in A:
    answer *= Ai
    if answer > 10 ** 18:
        answer = -1
        break

print(answer)
# Original solution
n = int(eval(input()));

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

ok = True;
ans = 1;
for val in a:
    ans *= val;

if(ans > 1e18):
    ok = False;
if(ok):
    print(ans);
else:
    print((-1));


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

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

ok = True;
ans = 1;
a.sort();
for val in a:
    ans *= val;
    if(ans > 1e18):
        ok = False;
        break;
    elif(ans == 0):
        break;

if(ok):
    print(ans);
else:
    print((-1));
# Original solution
n = int(eval(input()))

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

ans = 1

flag_0 = False

for a_i in a:
    
    if a_i == 0:
        flag_0 = True
        break

    ans *= a_i
    
    if ans > 10**18:
        ans = -1
        
if flag_0 == True:
    print((0))
elif ans <0:
    print((-1))
else:
    print(ans)

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

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

ans = 1

flag_0 = False

if 0 in a:
    print((0))
else:
    for a_i in a:
        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 = 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 = ans * A[i]
        if ans > 10**18:
            print((-1))
            break
    else:
        print(ans)
# Original solution
from sys import exit

ii = lambda : int(eval(input()))
mi = lambda : list(map(int,input().split()))
li = lambda : list(map(int,input().split()))

n= ii()
a= li()

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

# Optimized solution
from sys import exit
import math
ii = lambda : int(eval(input()))
mi = lambda : list(map(int,input().split()))
li = lambda : list(map(int,input().split()))

n= ii()
a= li()

ans=1
a.sort()
a.reverse()

if a[-1] == 0:
    print((0))
    exit()

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

t = 10**18


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

if li.count(0) >= 1:
    print((0))
    sys.exit()

ans = reduce(mul,li)

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

# Optimized solution
import sys

t = 10**18


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

if li.count(0) >= 1:
    print((0))
    sys.exit()

ans = 1
for i in range(n):
    ans = ans*li[i]
    if ans > t:
        print((-1))
        sys.exit()

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


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

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

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

    

if ans<=10**18:
    print(ans)
else:
    print((-1))
# Original solution
N = int(eval(input()))
Nums = input().split()

A = 1
break_flag = 0
for i in range(N):
  A*=int(Nums[i])
  if A > 10**18:
    A = -1
    break_flag = 1
  if A == 0:
    break_flag = 2

if break_flag == 1:
  print((-1))
else:
  print(A)

# Optimized solution
N = int(eval(input()))
Nums = input().split()

AA = set(Nums)

if '0' in AA:
  print((0))
else:
  A = 1
  for i in range(N):
    A*=int(Nums[i])
    if A > 10**18:
      A = -1
      break
  print(A)
# Original solution
eval(input())
r = 1
for x in input().split():
  r = max(-1, r * int(x))
  if r > 1e18:
    r = -1
print(r)


# Optimized solution
eval(input())
r = 1
for x in map(int, input().split()):
  if x == 0:
    r = 0
    break
  if r > 0:
    r *= x
    if r > 1e18:
      r = -1
print(r)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
ans = 1

if 0 in A:
  ans = 0
  N = 0
  
for i in range(N):
  ans *= A[i]
  if ans > 10**18:
    ans = -1
    break
    
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
N = int(eval(input()))

li = [int(s) for s in input().split()]

import functools
import operator

result = functools.reduce(operator.mul, li)

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

# Optimized solution
import sys

N = int(eval(input()))

Line = [int(s) for s in input().split()]
Line.sort()

ans = 1

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

print(ans)
# Original solution
def multiplication():
    # 入力
    N = int(eval(input()))
    A = list(map(int, input().split()))
    # 計算処理
    multi = 1
    for i in range(N):
        multi = multi * A[i]
    # 10^18比較
    if multi > 10 ** 18:
        return -1
    else:
        return multi

result = multiplication()
print(result)

# Optimized solution
def multiplication():
    # 入力
    N = int(eval(input()))
    A = list(map(int, input().split()))
    # かける数に0があるか確認
    if 0 in A:
        return 0
    # 計算処理
    multi = 1
    for i in range(N):
        multi = multi * A[i]
        # 10^18比較
        if multi > 10 ** 18:
            return -1
    return multi

result = multiplication()
print(result)
# Original solution
import sys
# sys.setrecursionlimit(10**10)
N = int(sys.stdin.readline().rstrip())
# S = sys.stdin.readline().rstrip()
# N, K = map(int, sys.stdin.readline().rstrip().split())
A = list(map(int, sys.stdin.readline().rstrip().split()))

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

# Optimized solution
import sys
# sys.setrecursionlimit(10**10)
N = int(sys.stdin.readline().rstrip())
# S = sys.stdin.readline().rstrip()
# N, K = map(int, sys.stdin.readline().rstrip().split())
A = list(map(int, sys.stdin.readline().rstrip().split()))

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

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

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

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


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


import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, *a = list(map(int, read().split()))

val=1
for x in a:
    val*=x

print((val if val<=10**18 else '-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)
    return

main ()
# Original solution
n = eval(input())
n = int(n)
a = input().split()
b = 1
for i in a:
    b *= int(i)
if (b > 1000000000000000000):
    print ("-1")
else:
    print (b)


# Optimized solution
n = eval(input())
n = int(n)
a = input().split()
b = 1
if '0' in a:
    print ("0")
else:
    for i in a:
        b *= int(i)
        if (b > 1000000000000000000):
            print ("-1")
            break
    if (b <= 1000000000000000000):
        print (b)
# Original solution
_ = eval(input())
inp = list(map(int, input().split()))

of = False
re = 1

for a in inp:
    re *= a


if (re - 1) // (10**18) > 0:
    re = -1

print(re)


# Optimized solution
_ = eval(input())
inp = list(map(int, input().split()))

re = 1


for a in inp:
    re = re * a
    if re > (10**18):
        of = True
        re = -1
        break


for a in inp:
    if a == 0:
        re = 0


print(re)
# Original solution
p=1
l=eval(input())
num=input().split()
for n in num:
    p*=int(n)
mx=pow(10,18)
if(p>mx):
    print("-1")
else:
    print(p)

# Optimized solution
p=1
mx=1000000000000000000
n=int(eval(input()))
num=input().split()
z=num.count('0')
if(z!=0):
    print('0')
else:    
    for i in num:
        p*=int(i)
        if(p>mx):
            p=-1
            break
    print(p)
# Original solution
eval(input())
a=1
for i in input().split():
  a*=int(i)
print(([a,-1][a>1000000000000000000]))

# Optimized solution
eval(input())
a=1
d=1000000000000000000
for i in input().split():
  a=min(a*int(i), d+1)
print(([a,-1][a>d]))
# Original solution
eval(input())
a=1
d=1000000000000000000
for i in input().split():
  a=min(a*int(i),d+1)
print(([a,-1][a>d]))

# Optimized solution
eval(input())
a=1
d=eval('1'+'0'*18)
for i in input().split():
  a=min(a*int(i),d+1)
print(([a,-1][a>d]))
# Original solution
eval(input());a=1;d=eval('1'+'0'*18)
for i in input().split():a=min(a*int(i),d+1)
print(([a,-1][a>d]))

# Optimized solution
a=1;d=eval('1'+'0'*18)
for i in open(0).read().split()[1:]:a=min(a*int(i),d+1)
print(([a,-1][a>d]))
# Original solution
eval(input());a=1
for i in input().split():a*=int(i);a=[-1,a][0<=a<=eval('1'+'0'*18)]
print(a)

# Optimized solution
eval(input());a=1
for i in input().split():a*=int(i);a=[-1,a][0<=a<=10**18]
print(a)
# Original solution
eval(input());a=1
for i in input().split():a*=int(i);a=[-1,a][0<=a<=10**18]
print(a)

# Optimized solution
a=1
for i in[*open(0)][1].split():a*=int(i);a=[-1,a][0<=a<=10**18]
print(a)
# Original solution
a=1;d=10**18
for i in[*open(0)][1].split():a=min(a*int(i),d+1)
print(([a,-1][a>d]))

# Optimized solution
a=1
for i in[*open(0)][1].split():a*=int(i);a=[-1,a][-2<a-1<1e18]
print(a)
# Original solution
_,b=open(0);a=1
for i in b.split():a*=int(i);a=[-1,a][-1<a<=1e18]
print(a)

# Optimized solution
a=1
for i in[*open(0)][1].split():a=[-1,a:=a*int(i)][-1<a<=1e18]
print(a)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=1
for i in a:
    ans*=i
    if a.count(0)==0 and ans>10**18:
        print((-1))
        exit()
print(ans)

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

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

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
b=1
for i in range(n):
  if a[i]==0:
    b=0

for i in range(n):
  b=b*a[i]
  if b>10**18:
    b=-1
    break
  
print(b)
# Original solution
import sys
#import time
import copy
#from collections import deque, Counter, defaultdict
#from fractions import gcd
#import bisect
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**20
ri = lambda : int(eval(input()))
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
n = ri()
a = rl()
ans=1
for i in a:
    ans*=i
    
if ans>10**18:
    print((-1))
else:
    print(ans)

# Optimized solution
import sys
#import time
import copy
#from collections import deque, Counter, defaultdict
#from fractions import gcd
#import bisect
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**20
ri = lambda : int(eval(input()))
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
n = ri()
a = rl()
ans=1
flag=False
for i in a:
    ans*=i
    if ans>10**18:
        flag=True
        break
   
zero=False
for i in a:
    if i==0:
        zero=True
        break
if zero:
    print((0))    
elif flag:
    print((-1))
else:
    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<=(10**18):
    print(ans)
else:
    print((-1))

# Optimized solution
n= int(eval(input()))
a=list(map(int,input().split()))
a.sort()
ans=1
for i in a:
    ans=ans*i
    if ans>(10**18):
        print((-1))
        break
    elif ans==0:
        print(ans)
        break
if ans<=(10**18)and ans!=0:
    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 > 1e18:
    ans = -1

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 range(N):
    ans *= A[i]
    if ans > 1e18:
        ans = -1
        break
print(ans)
# Original solution
import functools
import operator

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

answer = functools.reduce(operator.mul, A)

if answer > 1000000000000000000:
    print('-1') 
else:
    print(answer)

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

if A.count(0) >= 1:
    print((0))
    exit()

answer = 1
for _ in A:
    answer *= _
    if answer > 1000000000000000000:
        print('-1') 
        exit()

print(answer)
# 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()))
ans = 1
if a.count(0) > 0:
    print((0))
    exit()
else:
    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 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()))
A.sort()
ans = 1
for a in A:
    ans *= a
    if ans > 10 ** 18:
        print((-1))
        exit()
print(ans)
# Original solution
N=int(eval(input()))
result=1
A=input().split()
for j in range(N):
  result=result*int(A[j])
if(result>10**18):
  print((-1))
else:
  print(result)

# 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()