CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))
l = list(map(int, input().split()))
c = 1
for i in l:
  c *= i
if c <= 1000000000000000000:
  print(c)
else:
  print((-1))

# Optimized solution
n = int(eval(input()))
l = list(map(int, input().split()))
l.sort()
c = 1
i = 0
while i < n:
  c *= l[i]
  i += 1
  if c > 1000000000000000000:
    break
if c <= 1000000000000000000:
  print(c)
else:
  print((-1))
# Original solution
n = int(eval(input()))
a_list = list(map(int, input().split()))
res = 1
flag0 = False
if 0 in a_list:
  flag0 = True

for i in range(n):
  res = a_list[i]*res
  if res > 1000000000000000000 and flag0==False:
    res = -1
    break

print(res)

# Optimized solution
n = int(eval(input()))
a_list = list(map(int, input().split()))
a_list.sort(reverse=True)
res = 1
flag0 = False
if 0 in a_list:
  res = 0
else:
  for i in range(n):
    res = a_list[i]*res
    if res > 1000000000000000000:
      res = -1
      break

print(res)
# Original solution
import sys

INF = 10e17
N = int(eval(input()))
A = list(map(int, sys.stdin.readline().rstrip().split()))
ans = 1
for i in range(N//2):
    ans = ans*A[i]*A[N-1-i]
    if ans == 0:
        print((0))
        sys.exit()
if N%2:
    ans = ans*A[N//2]
if ans > INF:
    print((-1))
else:
    print(ans)

# Optimized solution
import sys

INF = 10e17
N = int(eval(input()))
A = list(map(int, sys.stdin.readline().rstrip().split()))
ans = 1
for a in A:
    if a == 0:
        print((0))
        sys.exit()
for a in A:
    ans = ans*a
    if ans > INF:
        print((-1))
        sys.exit()

print(ans)
# Original solution
#from pprint import pprint
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from copy import deepcopy
#from itertools
#from bisect import bisect_right #二分探索用のモジュール bisect_right(a_list,value)

#import sys 
#sys.setrecursionlimit(N) #N回まで再起を許可する。

# = int(input())

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

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

# = [list(map(int,input().split())) for _ in range(XXXX)]

n = int(eval(input()))

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

result = 1

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

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


# Optimized solution
#from pprint import pprint
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from copy import deepcopy
#from itertools
#from bisect import bisect_right #二分探索用のモジュール bisect_right(a_list,value)

#import sys 
#sys.setrecursionlimit(N) #N回まで再起を許可する。

# = int(input())

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

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

# = [list(map(int,input().split())) for _ in range(XXXX)]

n = int(eval(input()))

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

result = 1
overflg = 0

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

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

print(result)
# Original solution
n = int(eval(input()))
A = list(map(int, input().split()))
A.sort()

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

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

ans = 1
for a in A:
    ans *= a
    if ans > 10 **18:
        print((-1))
        exit()
print(ans)
# Original solution
import math

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

result = 1
for A in Alist:
  result *= A

if result > 1000000000000000000:
  print("-1")
else:
  print(result)

# Optimized solution
import math

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

result = 1
for A in Alist:
  result *= A
  if result > 1000000000000000000:
    if 0 in Alist:
      result = 0
    break

if result > 1000000000000000000:
  print("-1")
else:
  print(result)
# Original solution
n=int(eval(input()))
ans=1;
for a in input().split():
    ans*=int(a)
if (ans>1000*1000*1000*1000*1000*1000):
    print((-1))
else:
    print(ans)


# Optimized solution
n=int(eval(input()))
ans=1;
i = []
for a in input().split():
    i.append( int(a) )
    if (int(a)==0):
        print((0))
        exit(0)
for l in i:
    ans*=l
    if (ans>1000*1000*1000*1000*1000*1000):
        print((-1))
        exit(0)
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
k = 1
flag = True
for i in a:
  k *= i
  
if k > 10 ** 18:
  print((-1))
  flag = False
if flag:
  print(k)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
k = 1
flag = True
for i in a:
  k *= i  
  if k > 10 ** 18:
    flag = False
    break

if 0 in a:
  print((0))
elif flag:
  print(k)
else:
  print((-1))
# Original solution
N=int(eval(input()))
A_list = list(map(int,input().split()))

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

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

MAX = 10**18
ans = 1
isZero = False
isOverFlow = False
for a in A_list:
  if a == 0:
    isZero = True
    break
  if not isOverFlow:
    ans *= a
  if ans > MAX:
    isOverFlow = True

if isZero:
  print((0))
elif isOverFlow:
  print((-1))
else:
  print(ans)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
x=1

for i in range(n):
  x*=a[i]
  
print((x if x<=1000000000000000000 else "-1"))

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

for i in range(n):
  x*=a[i]
  if x<=1000000000000000000:
    pass
  else:
    print("-1")
    exit()
  
print(x)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=1
for i in a:
  if i!=0:
    ans=ans*i
  else:
    print((0))
    quit()
print((ans if ans<=10**18 else -1))

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

MAX = 10**18
ans = 1

for i in a:
    ans *= i
    
if ans > MAX:
    print((-1))
else:
    print(ans)

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

MAX = 10**18
ans = 1

for i in a:
    ans *= i
    if ans > MAX:
        print((-1))
        sys.exit()

print(ans)
# Original solution
N = int(eval(input()))
A = input().split()
for i in range(len(A)):
    A[i] = int(A[i])

answer = A[0]
overl = False

for i in range(N-1):
    answer *= A[i+1]

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

# Optimized solution
N = int(eval(input()))
org = input().split()
for i in range(len(org)):
    org[i] = int(org[i])
A = sorted(org)

answer = A[0]
overl = False

for i in range(N-1):
    answer *= A[i+1]
    if answer > 10**18:
        overl = True
        break

if overl:
    print("-1")
else:
    print(answer)
# Original solution
N = eval(input())
A = list(map(int, input().split()))

result = 1

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


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

result = 1
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 = list(map(int,input().split()))

k = 0
for i in range(N):
  if A[i] == 0:
    k = 1
  elif A[i] != 0 and A[i] > 10**18:
    k = 2
  else:
    k = 3

if k == 1:
  print((0))
elif k == 2:
  print((-1))
else:
  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()))
a = 0
for i in range(N):
  if A[i] == 0:
    a = 1
    break
  elif A[i] > 10**18:
    a = 2
    break

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

  if b == 0:
    print(ans)
  else:
    print((-1))
# 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
A.sort()
for i in A:
    ans*=i
    if ans==0:
        break
    if ans>(10**18):
        ans="-1"
        break

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

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

#print(a)

ans = int(a[0])
for i in range(1,N):
    ans = ans * int(a[i])

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


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

#print(a)

ans = int(a[0])
for i in range(1,N):
    if ans > 10**18:
        break
    else:
        ans = ans * int(a[i])
if 0 in a:
    print((0))
elif ans > 10**18:
    print((-1))
else:
    print(ans)
# Original solution
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(eval(input()))
    A = tuple(map(int, input().split()))
    MAX_V = 10 ** 18

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

    ans = 1
    for a in A:
        ans *= a
        if ans > MAX_V:
            ans = -1
    print(ans)

if __name__ == '__main__':
    main()


# Optimized solution
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(eval(input()))
    A = sorted(map(int, input().split()), reverse=True)
    MAX_V = 10 ** 18

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

    ans = 1
    for a in A:
        ans *= a
        if ans > MAX_V:
            ans = -1
            break
    print(ans)

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

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
if 0 in A:
    print((0))
    exit(0)
ans = 1
for i in A:
    ans = ans * i
    if ans > pow(10, 18):
        print((-1))
        exit(0)
else:
    print(ans)
# Original solution
n=int(eval(input()))
ans=1
l=list(map(int, input().split()))
for x in l:
    ans*=x

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

print(ans)

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

for x in l:
    ans *= x

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

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

p = 1
for i in range(N):
  p*=arr[i]
    
if p > pow(10,18):
  print((-1))
else:
  print(p)


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

if 0 in arr:
  print((0))
else:
  p = 1
  for i in arr:
    p *= i
    if p>1000000000000000000:
      p = -1
      break
  print(p)
# Original solution
n=int(eval(input()))
l=list(map(int,input().split()))
m=1
maxx=10**18
flag=0
for i in range(n):
    m*=l[i]
    if m==0:
        print((0))
        flag=1
        break
if flag!=1:
    if m>maxx:
        print((-1))
    else:
        print(m)


# Optimized solution
n=int(eval(input()))
l=list(map(int,input().split()))
m=1
maxx=10**18
flag=0
for i in range(n):
   if l[i]==0:
       print((0))
       flag=1
       break
if flag!=1:
    flag=0
    for i in range(n):
        m*=l[i]
        if m>maxx:
            print((-1))
            flag=1
            break

    if flag!=1:
        print(m)
# Original solution
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

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

num = 1
for x in range(n):
    num *= a[x]
    if num == 0:
        break
    if 10**18 < num:
        if 0 in a[x:]:
            num = 0
        else:
            num = -1

print(num)


# Optimized solution
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

n = int(eval(input()))
a = list(map(int,input().split()))
if 0 in a:
    print("0")
else:
    num = 1
    for x in range(n):
        num *= a[x]
        if 10**18 < num:
            num = -1
            break

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

s=1
for i in ls:
    s*=i

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

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

s=1
over=False

if 0 in ls:
    s=0
else:
    for i in ls:
        s*=i
        if s>10**18:
            over=True
            break


if over:
    print((-1))
else:
    print(s)
# Original solution
import sys
sys.setrecursionlimit(1000000)
N=int(eval(input()))
A=list(map(int,input().split()))
def f(i):
  if i==0:
    return 1
  else:
    return f(i-1)*A[i-1]
a=f(N)
print((a if a<=10**(18) else -1))






# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
a=1
k=0
if 0 in A:
  print((0))
else:
  for i in range(N):
    a*=A[i]
    if a>10**(18):
      k=1
      break
  if k==1:
    print((-1))
  else:
    print(a)
# Original solution
def multiply(arr):
    ans = 1
    for i in arr:
        ans *= i
    if ans > 1000000000000000000:
            return -1
    return ans
n = int(eval(input()))
nums = list(map(int, input().split(' ')))
print((multiply(nums)))

# Optimized solution
def multiply(arr):
    ans = 1
    if 0 in arr:
        return 0
    for i in arr:
        ans *= i
        if ans > 1000000000000000000:
            return -1
    return ans
n = int(eval(input()))
nums = list(map(int, input().split(' ')))
print((multiply(nums)))
# Original solution

N = int(eval(input()))

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



ans = 1

for i in range(N):
    ans = ans * aaa[i]

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






# Optimized solution

N = int(eval(input()))

aaa = list(map(int, input().split()))
ans = 1

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


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


print(ans)
# Original solution
n = int(eval(input()))
A = (list(map(int,list(input().split()))))
tmp = 1
for i in A:
    tmp = tmp * i
    if tmp == 0:
        print(tmp)
        quit()

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

# Optimized solution
n = int(eval(input()))
A = (list(map(int,list(input().split()))))
tmp = 1
for i in A:
    tmp = tmp * i
    if tmp == 0:
        print(tmp)
        quit()
    if tmp > 10**18:
        if 0 in A:
            print((0))
            quit()
        tmp=-1
        print(tmp)
        quit()
    
print(tmp)
# Original solution
n = int(eval(input()))
num = [int(i) for i in input().split()]

q = 1

for i in num:
    q=q*i
    if i == 0:
        q=0
        break

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


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

cont=0
ans=1

for j in num:
    if j == 0: cont+=1

if cont > 0: print((0))
else:
    for i in num:
        ans=ans*i
        if ans>1e18:
            ans=-1
            break
    print(ans)
# Original solution
from operator import mul
from functools import reduce
a=int(eval(input()))
li = list(map(int,input().split()))

j = reduce(mul, li)
if j > 10**18:
  print((-1))
else:
  print(j)

# Optimized solution

a=int(eval(input()))
li = list(map(int,input().split()))
if 0 in li:
  print((0))
  
else:
  result = 1
  for number in li:
    result = result * number
    if result > 10**18:
      print((-1))
      break

  if result <= 10**18:
    print(result)
# Original solution
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    if 0 in a:
        print((0))
    else:
        cur = 1
        for x in a:
            cur *= x
        if cur > 10 ** 18:
            print((-1))
        else:
            print(cur)


if __name__ == '__main__':
    main()


# Optimized solution
import sys

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

if 0 in a:
    print((0))
else:
    cur = 1
    for x in a:
        cur *= x
        if cur > 10 ** 18:
            print((-1))
            sys.exit()
    print(cur)
# Original solution
import sys

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

if 0 in a:
    print((0))
else:
    cur = 1
    for x in a:
        cur *= x
        if cur > 10 ** 18:
            print((-1))
            sys.exit()
    print(cur)

# Optimized solution
import sys  # sys.exit()を使いたいので

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

if 0 in a:
# 0が1つでもあれば0です
    print((0))
else:
# 0がない場合
    cur = 1  # 現在の数値
    for x in a:
        cur *= x
        if cur > 10 ** 18:
        # 10**18を超えたので終了します
            print((-1))
            sys.exit()
    print(cur)  # 10**18以下なので、出力します
# Original solution
from functools import reduce
from operator import mul

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

res = reduce(mul, N_s)

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

print(res)


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

if "0" in A_str:
    print((0))
    exit()

res = 1
for A in A_array:
    res *= A
    if res > 10 ** 18:
        res = -1
        break

print(res)
# Original solution
def main():
    N = int(eval(input()))
    A_list = list(map(int, input().split()))

    ans = 1
    for i in A_list:
        ans *= i
        if 1000000000000000000 < ans and 0 not in set(A_list):
            print('-1')
            exit()
        elif ans == 0:
            print((0))
            exit()
    else:
        print(ans)


main()

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

    if 0 in set(A_list):
        print((0))
        exit()

    ans = 1
    for i in A_list:
        ans *= i
        if 1000000000000000000 < ans:
            print('-1')
            exit()
    else:
        print(ans)


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

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

# Optimized solution
import sys  # sys.exit()を使いたいので

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

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

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

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


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

x = 1
if 0 in a:
    print((0))
else:
    for i in range(n):
        x *= a[i]
        if x > 1e18:
            print((-1))
            exit()
    print(x)
# Original solution
import sys
n=int(eval(input()))
a=list(map(int,input().split()))

import functools
import operator

result = functools.reduce(operator.mul, a)
if result>10**18:
    print((-1))
else:
    print(result)

# Optimized solution
import sys
n=int(eval(input()))
a=list(map(int,input().split()))
a.sort(reverse=True)
s=a[n-1]
if s==0:
    print((0))
else:
    for i in range(0,n-1):
        s*=a[i]
        if s>10**18:
            print((-1))
            sys.exit()
    print(s)
# Original solution
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
ipnl = lambda n: [int(eval(input())) for _ in range(n)]
inp = lambda :int(eval(input()))
ip = lambda :[int(w) for w in input().split()]

n = inp()
x = ip()
ele = 10**18
prod = 1
for i in x:
    prod *= i
    if prod == 0:
        print((0))
        exit()
if prod > ele:
    print((-1))
    exit()
print(prod)

# Optimized solution
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
ipnl = lambda n: [int(eval(input())) for _ in range(n)]
inp = lambda :int(eval(input()))
ip = lambda :[int(w) for w in input().split()]

n = inp()
x = ip()
ele = 10**18
prod = 1
if 0 in x:
    print((0))
    exit()
for i in x:
    prod *= i
    if prod > ele:
        print((-1))
        exit()
print(prod)
# Original solution
from functools import reduce

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

MAX  = 10 ** 18
OVER = MAX + 1

result = reduce(lambda x, acc: x * min(acc, OVER), xs)

if result <= MAX:
  print(result)
else:
  print((-1))

# Optimized solution
from functools import reduce

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

MAX  = 10 ** 18

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

result = 1
  
for x in xs:
  result *= x
  
  if result > MAX:
    print((-1))
    exit(0)
    
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 > 10**18:
    print((-1))
else:
    print(ans)

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

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
ans=1
mod=10**18
for i in A:
    if i==0:
        ans=0
        break
    elif i==1:
        continue
    elif ans!=-1:
        ans=ans*i
        if ans>mod:
            ans=-1
print(ans)
# Original solution
import functools
import operator

n = int(eval(input()))
li = [int(i) for i in input().split()]
result = functools.reduce(operator.mul, li)

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

# Optimized solution
n = int(eval(input()))
A = [int(i) for i in input().split()]
the = pow(10,18)
ans = 1

if 0 in A:
    print((0))
else:
    for i in range(n):
        ans *= A[i]
        if ans >the:
            print((-1))
            break
        else:
            continue
    if ans <= the:
        print(ans)
# Original solution
N = int(eval(input()))
L_A = [int(s) for s in input().rstrip().split(' ')]
k = 1
for i in range(N):
    if L_A[i] == 0:
        print((0))
        break
    else:
        k *= L_A[i]
else:
    if k > 10**18:
        print("-1")
    else:
        print(k)

# Optimized solution
N = int(eval(input()))
L_A = [int(s) for s in input().rstrip().split(' ')]
if 0 in L_A:
    print((0))
else:
    k = 1
    for i in range(N):
        k *= L_A[i]
        if k > 10**18:
            print("-1")
            break
    else:
        print(k)
# Original solution
n = int(eval(input()))
alist = list(map(int, input().split()))
num = 1
for a in alist:
    num = num * a

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

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

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

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

print(num)