CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))
a = [int(x) for x in input().split()]

ans = 1

ok = True
for i in range(n):
    ans *= a[i]
    if ans > 10 ** 18:
        ok = False

if ok == True or ans == 0:
    print(ans)
else:
    print((-1))

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

ans = 1

ok = True
for i in range(n):
    ans *= a[i]
    if ans > 10 ** 18:
        ok = False
        break

for i in range(n):
    if a[i] == 0:
        ok = True
        ans = 0

if ok == True:
    print(ans)
else:
    print((-1))
# Original solution
n = int(eval(input()))
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    res = 0
for x in ls:
    res *= x
    if res > 10**18:
        res = -1
print(res)

# Optimized solution
n = int(eval(input()))
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print((0))
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print((-1))
        quit()
print(res)
# Original solution
N=int(eval(input()))
alist=list(map(int,input().split()))
alist.sort()

answer=1
for a in alist:
  answer*=a
  if answer==0:
    print((0))
    break
  elif answer>10**18:
    print((-1))
    break
else:
  print(answer)

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

if alist[0]==0:
  print((0))
  sys.exit(0)

answer=1
e18=10**18
for a in alist:
  answer*=a
  if answer>e18:
    print((-1))
    break
else:
  print(answer)
# 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=sorted(list(map(int,input().split())))
if A[0]==0:
  print((0))
  exit(0)
ans=1
for a in A[::-1]:
  ans*=a
  if ans>10**18:
    print((-1))
    exit(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 > 1000000000000000000:
    print((-1))
else:
    print(ans)


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
a = sorted(a)
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 1000000000000000000:
        print((-1))
        exit(0)
print(ans)
# Original solution
def intlist(x):
    y = []
    for i in range(len(x)):
        y.append(int(x[i]))
    return y
N = int(eval(input()))
A = intlist(input().split())
M = 1

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

# Optimized solution
def intlist(x):
    y = []
    for i in range(len(x)):
        y.append(int(x[i]))
    return y
N = int(eval(input()))
A = intlist(input().split())
M = 1

A.sort()
if A[0] == 0:
    M = 0
else:
    for i in range(N):
        M = M * A[i]
        if M > 10**18:
            M = -1
            break
print(M)
# Original solution
n = int(eval(input()))

ans = 1
for i in map(int, input().split()):
    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))
else:
    for i in a:
        ans = ans * i
        if ans > 10 ** 18:
            print((-1))
            break
    else:
        print(ans)
# Original solution
import math
import string
import collections
from collections import Counter
from collections import deque


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(eval(input()))
a = readints()
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 10**18:
    print((-1))
else:
    print(ans)


# Optimized solution
import math
import string
import collections
from collections import Counter
from collections import deque


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(eval(input()))
a = readints()
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()))
num_list = list(map(int, input().split()))

ans = 1

for e in num_list:
    ans *= e

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


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

ans = 1

for e in num_list:
    if e == 0:
        ans = 0

for e in num_list:
    ans *= e
    if ans > 1000000000000000000:
        ans = -1
        break
    if ans == 0:
        break

print(ans)
# Original solution
n = eval(input())

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

MAX = 10**18

ans = 1
for num in nums:
    ans = ans*num

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

# Optimized solution
n = eval(input())
 
nums = list(map(int, input().split()))
 
MAX = 10**18

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

ans = 1
for num in nums:
    ans = ans*num 
    if ans > MAX:
        print((-1))
        exit()

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


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

print(ans)

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

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

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

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

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

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

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

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

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

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

ans = 1
for i in alist:
    ans *= i
    if 0 in alist:
        ans = 0
        break
    elif ans > 10**18:
        ans = -1
        break

print(ans)

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

ans = 1
if 0 in alist:
    ans = 0
else:
    for i in alist:
        ans *= i
        if ans > 10**18:
            ans = -1
            break

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

sum=1

for i in range(a):
    sum = sum*li[i]

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


# Optimized solution
#１文字をインプット
a=int(eval(input()))
#1行をint型でインプット
li = list(map(int,input().split()))

#初期値をセット
sum=1

#リストに入っている分だけ掛ける
if 0 in li:#もしリストに0が入っていたら合計を0にして、34行目へ
    sum = 0
else:
    for i in range(a):
        sum = sum*li[i]
        if sum > 10**18:
            break

if sum <= 10**18:#10の18乗以下の場合、答えを出力
    print(sum)
else:#10の18乗を超える場合、'-1'を出力
    print((-1))
# Original solution
N = int(eval(input()))
A = sorted(list(map(int,input().split())))
ans = A[0]
if ans == 0:
    print(ans)
    exit()
else:
    for i in range(1,N):
        ans = ans * A[i]
    if ans > 10**18:
        ans = -1
    print(ans)

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

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

print((-1 if M > 1e18 else M))

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

if 0 in A:
    print((0))
else:
    M = 1
    for a in A:
        M *= a
        if M > 1000000000000000000: break

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

# Optimized solution
n = int(eval(input()))
arr = [int(x) for x in input().split()]
res = 1
flag = False
for i in range(n):
    if flag == False:
        res *= arr[i]
    if arr[i] == 0:
        print((0))
        exit()
    if res > 10**18:
        flag = True
if res > 10**18:
    print((-1))
else:
    print(res)
# Original solution
import math as mt
N = int(eval(input()))
A = [int(x) for x in input().split()]
a = 1
for i in range(N):
    a *= A[i]
if a > 1000000000000000000:
    print((-1))
else:
    print(a)
    

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

        if a > 1000000000000000000:
            a = -1
            break
print(a)
# Original solution
n = int(eval(input()))
a = [int(x) for x in input().split()]

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

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

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

abc=0

for i in range(n):
	if(a[i]==0):
		abc=1
		break
if(abc==1):
	print((0))
else:
	ans=1
	for i in range(n):
		ans*=a[i]
		if(ans>1000000000000000000):
			break

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

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

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
B = 1
# print(max(A))
if 0 in A:
    print((0))
elif max(A) > 10**18:
    print((-1))
else:
    for i in A:
        B *= i
        if B > 10 ** 18:
            B = -1
            break
    print(B)
# Original solution
from functools import reduce
n=int(eval(input()))
l1=list(map(int,input().split()))
a = reduce((lambda x, y: x * y), l1) 
if a>10**18:
  print("-1")
else:
  print(a)

# Optimized solution

n=int(eval(input()))
l1=list(map(int,input().split()))
p=1
k=0
if 0 in l1:
  print("0")
  exit()
for i in range(n):
  p*=l1[i]
  if p>10**18:
    k=1
    break
if k==1:
  print("-1")
else:
  print(p)
# Original solution
N = int(eval(input()))
A = [int(i) for i in 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([int(i) for i in input().split()])

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

N = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
for a in A:
    if a == 0:
        print((0))
        sys.exit()
    ans *= a

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


# Optimized solution
import sys

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

if 0 in A:
    print((0))
    sys.exit();

ans = 1
for a in sorted(A, reverse=True):
    ans *= a
    if ans > 10**18:
        print((-1))
        break
else:
    print(ans)
# Original solution
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return list(map(int,sys.stdin.readline().rstrip().split()))
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
from operator import mul
from functools import reduce
N = I()
A = LI()
ans = reduce(mul, A)
if ans > 10**18:
    ans = -1
print(ans)

# Optimized solution
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return list(map(int,sys.stdin.readline().rstrip().split()))
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A = LI()
ans = A[0]
if 0 in A:
    ans = 0
else:
    for i in range(1, N):
        if ans > 10**18:
            ans = -1
            break
        else:
            ans = ans*A[i]
if ans > 10**18:
    ans = -1
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]
# print(len(str(ans))-1)
if ans<=10**18:
    print(ans)
else:
    print((-1))

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
ans = 1
Flag = True
zero_flag = False
for i in range(N):
    if A[i]==0:
        zero_flag = True
        break
for i in range(N):
    ans = ans*A[i]
    if ans > 10**18:
        Flag = False
        break
        
# print(len(str(ans))-1)
if zero_flag:
    print((0))
elif ans<=10**18 or Flag:
    print(ans)
else:
    print((-1))
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
INF = int(1e18)
ans = 1
for i in range(N): ans*=A[i]
if(ans>INF): print((-1))
else: print(ans)

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


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

# Optimized solution
#ABC169-B
n=int(eval(input()))
c=list(map(int, input().split()))
ans=1
if 0 in c:
  print((0))
else:
  for i in range(n):
    ans*=c[i]
    if ans>10**18:
      ans=-1
      break
  print(ans)
# Original solution
from collections import defaultdict, deque
import sys

INF = float('inf')
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n = I()
a = LI()
ans = 1
for ai in a:
    ans *= ai
    if ans > 10 ** 18:
        ans = -1
print(ans)


# Optimized solution
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())


n = I()
a = LI()
ans = a[0]
if 0 in a:
    print((0))
    sys.exit()

for ai in a[1:]:
    ans *= ai
    if ans > 10 ** 18:
        ans = -1
        break

print(ans)
# Original solution
n = int(eval(input()))
a = 1
l = input().split()
for i in range(n):
    a *= int(l[i])

if a > 1000000000000000000 :
    print((-1))
else :
    print(a)


# Optimized solution
n = int(eval(input()))
a = 1
f1 = 0
f2 = 0
l = input().split()
for i in range(n):
    a *= int(l[i])
    if a > 1000000000000000000 :
        f1 = 1
        a = 1
    if a == 0:
        f2 = 1
    
if f2 == 1:
    print((0))
elif f1 == 1:
    print((-1))
else :
    print(a)
# Original solution
import sys

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

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

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

# Optimized solution
import sys

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

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

# Optimized solution
n, *a = list(map(int, open(0).read().split()))
ans = 1
if 0 in a:
    ans = 0
else:
    for i in a:
        ans *= i
        if ans > 10**18:
            ans = -1
            break
print(ans)
# Original solution
import sys
import math

N = int(eval(input()))

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

sum0 = str_list[0]

for n in range(1,N):
    sum0 = sum0 * str_list[n]
if sum0 > 10**18:
    print('-1')
else:
    print(sum0)

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

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

sum0 = str_list[0]

for n in range(0,N):
    if str_list[n] == 0:
        sum0 = 0

for n in range(1,N):
    if sum0 == 0:
        break
    sum0 = sum0 * str_list[n]
    if sum0 > 10 ** 18:
        sum0 = -1
        break

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

# Optimized solution
def main():

    N = int(input())
    lista = [int(x) for x in input().split()]
    q = 1
    if 0 in lista:
        return print(0)
    for i in lista:
        q *= i
        if q > 10**18:
            print(-1)
            return
    print(q)


main()
# Original solution
from functools import reduce
from operator import mul

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

result = reduce(mul, a_list)

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

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

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

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

from math import prod

if __name__ == '__main__':
    n = eval(input())
    a = list(map(int, input().split(' ')))
    s = prod(a)
    if s > 10**18:
        print((-1))
    else:
        print(s)

# Optimized solution
#
# author Sidratul
#

from math import prod

if __name__ == '__main__':
    n = eval(input())
    a = list(map(int, input().split(' ')))
    s = 1
    a.sort()
    x = True
    for i in range(len(a)):
        s = s * a[i]
        if s > 10**18:
            print((-1))
            x = False
            break
    if x:
        print(s)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

r = 1
for num in A:
  r *= num
  if r == 0:
    break
print((-1 if r > 10 ** 18 else r))


# 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
a=int(eval(input()))
l=[int(i) for i in input().split()]
mul=1
for i in l:
    mul*=i
if mul>10**18:
    print((-1))
else:
    print(mul)
    

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

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


# Optimized solution
import sys
n=int(eval(input()))
a=[int(x) for x in input().rstrip().split()]
a.sort()
if a[0]==0:
  print((0))
else:
  ans=1
  for i in a:
    ans*=i
    if 10**18<ans:
      print((-1))
      sys.exit()
  print(ans)
# Original solution

def main():
    import sys
    import math
    def input():
        return sys.stdin.readline()[:-1]
    N=int(eval(input()))
    A=list(map(int,input().split()))
    c=1
    for x in A:
        c=c*x
    
    if c>10**18:
        print((-1))
        sys.exit()

    print(c)
if __name__ == '__main__':
    main()


# Optimized solution

def main():
    import sys
    import math
    def input():
        return sys.stdin.readline()[:-1]
    N=int(eval(input()))
    A=list(map(int,input().split()))
    c=1
    if 0 in A:
        print((0))
        sys.exit()
        
    for x in A:     
        c=c*x
        if c>10**18:
            print((-1))
            sys.exit()

    print(c)
if __name__ == '__main__':
    main()
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
sum=1
for i in a:
    sum*=i
if sum>1000000000000000000:
    print((-1))
else:
    print(sum)

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

def main(a):
  if 0 in a:
    ans = 0
  else:
    ans = 1
    for item in a:
      ans *= item
      if ans > 1000000000000000000:
        ans = -1
  return ans

ans = main(a)
print(ans)


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

def main(a):
  if 0 in a:
    ans = 0
  else:
    ans = 1
    for item in a:
      ans *= item
      if ans > 1000000000000000000:
        ans = -1
        break
  return ans

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

ans = 1
for a in A:
  ans *= a
  if ans == 0:
    break

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


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

print(ans)