CodeEff/ECCO huggingface dataset:
# Original solution
N = int(eval(input()))
A = [int(a) for a in input().split()]
s = 1
for a in A:
    s *= a
print((s if s <= 10 ** 18 else -1))

# Optimized solution
N = int(eval(input()))
A = [1] * N + [int(a) for a in input().split()]
for i in range(N-1, 0, -1):
    A[i] = A[2*i] * A[2*i+1]
print((A[1] if A[1] <= 10 ** 18 else -1))
# Original solution
N = int(eval(input()))
L = list(map(int, input().split()))
M = 1
for i in L:
  M *= i
if M > 1000000000000000000:
  print((-1))
else:
  print(M)

# Optimized solution
N = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
M = 1
for i in L:
  M *= i
  if M > 10**18:
    M = -1
    break
print(M)
# Original solution
n = int(eval(input()))
li = list(map(int,input().split()))
ans=1
for i in li:
    ans*=i
    if ans>10**18:
        ans=-1
if ans<0:
    ans=-1
print(ans)

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

import math


def main():
    N = int(eval(input()))
    A = [int(arg) for arg in input().split()]
    ans = 1
    for i in range(N):
        ans *= A[i]

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


if __name__ == '__main__':
    main()


# Optimized solution

def main():
    N = int(eval(input()))
    A = [int(arg) for arg in input().split()]
    ans = 1

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

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

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
N=int(eval(input()))
x=1
for a in list(map(int,input().split())):
    x*=a
print((-1 if x>10**18 else x))

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

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

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

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

if 0 in lst:
    print("0")
    quit()

res = 1
for a in lst:
    res = res*a
    if res > 1000000000000000000:
        print("-1")
        quit()
    else:
        pass

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

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

# Optimized solution
import sys

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

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

result = 1
A.sort()
for i in A:
    result *= i
    if result > 10**18:
        result = -1
        break

print(result)


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

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

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

# Optimized solution
N = int(eval(input()))
A = 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()))
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
import sys

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

for a in A:
    ans *= a
    if ans > 1e18:
        print((-1))
        sys.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((-1))
else:
  print(ans)

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

ans = 1

if min(A) == 0:
  print((0))
else:
  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()))

ans = 1

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

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

print(ans)


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

from operator import mul
from functools import reduce

a = reduce(mul, x)

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

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

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

# Optimized solution
import sys
n = int(eval(input()))
l = list(map(int,input().split()))
##print(n)
##print(l)
x = l[0]
if 0 in l:
  print((0))
  sys.exit()
for i in range(1,n):
  ##print(i)
  ##print(l[i])
  x *= l[i]
  if x >+ 1000000000000000000:
    ##print(i)
    ##print(x)
    print((-1))
    sys.exit()
print(x)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))

ans = 1
check = 10 ** 18

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

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

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

ans = 1
check = 10 ** 18

for i in range(N-1,-1,-1):
    ans *= A[i]
    if ans > check:
        print((-1))
        exit()

print(ans)
# Original solution
N = int(eval(input()))
A_list = list(input().split())

answer = 1
for a in A_list:
    answer *= int(a)

if len(str(answer-1))>18:
    print((-1))
else:
    print(answer)


# Optimized solution
N = int(eval(input()))
A_list = list(map(int,input().split()))
A_list.sort()
#print(A_list)
if A_list[0]==0:
    answer = 0
else:      
    answer = 1
    for a in A_list:
        answer *= a
        if len(str(answer-1)) > 18:
            answer = -1
            break
print(answer)
# Original solution
N = int(eval(input("")))
A = list(map(int, input("").split()))
n = 1

for i in range(N):
    n = n * A[i]

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

print(n)

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

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

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

ans = 1
max_ans = 10**18
for num in num_list:
    ans = ans * num

if ans > max_ans:
    ans = -1


print(ans)

# Optimized solution
n = eval(input())
list = input().split()

ans = 1
max_ans = 10**18

if "0" in list:
    ans = 0
else:       
    for num in list:
        ans = ans * int(num)
        if ans > max_ans:
            ans = -1
            break

print(ans)
# Original solution
def main():
	import sys
	input = sys.stdin.readline
	k = int(eval(input()))
	h = tuple(map(int,input().split()))
	ans = 1
	for i in range(k):
		ans *= h[i]
	if ans <= 10 **18:
		print(ans)
	else:
		print((-1))
	
 
 
if __name__ == '__main__':
	main()

# Optimized solution
def main():
	k = int(eval(input()))
	h = tuple(map(int,input().split()))
	ans = 1
	avoid = 0
	if (0 in h):
		print((0))
	else:
		for i in range(k):
			ans = h[i] * ans
			if ans > 10 **18:
				print((-1))
				avoid = 1
				break
		if avoid == 0:
			print(ans)
	


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

print(ans)

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

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

ans = 1

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

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

print(ans)
# Original solution
from functools import reduce

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

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
limit=10**18
a.sort()
result=a[0]
for k in a[1:]:
    result*=k
    if result > limit:
        print((-1))
        exit()
print(result)
# Original solution
eval(input())
l = list(map(int, input().split()))
res = 1
for x in l:
  res *= x
if res > 10**18:
  res = -1
print(res)

# Optimized solution
eval(input())
l = list(map(int, input().split()))
l.sort()
res = 1
for x in l:
  res *= x
  if res > 10**18:
    print((-1))
    exit(0)
print(res)
# 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))
else:
    for i in A:
        ans = ans * i
        if ans > 10**18:
            ans = -1
            break
    print(ans)
# Original solution
N = int(eval(input()))
A_list = list(map(int,input().split()))
output = 1
flug = 0

if 0 in A_list:
    print((0))
    flug = 1
if flug != 1:
    for i in range(N):
        output *= A_list[i]
        
        if (output > 10 ** 18):
            print((-1))
            flug = 1
            break
if(flug != 1):
    print(output)

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


# Optimized solution
n = int(eval(input()))
number = list(map(int, input().split()))
seki = 1
if 0 in number:
  seki = 0
else:
  for i in number:
    seki = seki*i
    if seki > 10 ** 18:
      seki = -1
      break
    else:
      continue
print(seki)
# Original solution
a=int(eval(input()))
b=input().split(' ')
m=0
s=1
i=0
o=0
while i<a:
    if int(b[i])==0:
        print((0))
        o=o+1
    i=i+1
while m<a:
    s=s*int(b[m])
    m=m+1
    if s>10**18 and o==0:
        print((-1))
        o=o+1
        break

if o==0:
    print(s)


# Optimized solution
a=int(eval(input()))
b=input().split(' ')
m=0
s=1
i=0
o=0
while i<a:
    if int(b[i])==0:
        print((0))
        o=o+1
    i=i+1
while m<a and o==0:
    s=s*int(b[m])
    m=m+1
    if s>10**18 and o==0:
        print((-1))
        o=o+1
        break

if o==0:
    print(s)
# Original solution
n = int(eval(input()))
arr = [int(x) for x in input().split(' ')]

ans = 1
for x in arr:
    ans *= x
    
if ans > int(1e18):
    print((-1))
else:
    print(ans)

# Optimized solution
n = int(eval(input()))
arr = []

z=False
for x in input().split(' '):
    if x == '0':
        z = True
    arr.append(int(x))
if z == True:
    print((0))

else:
    ans = 1
    for x in arr:
        ans *= x
        if ans > int(1e18):
            print((-1))
            exit(0)
    
    print(ans)
# Original solution
eval(input())
nums = list(map(int,input().split()))

if nums.count(0):
    print((0))
    exit(0)

result=1
for i in nums:
    result *= i

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

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

if nums.count(0):
    print((0))
    exit(0)

result=1
for i in nums:
    result *= i
    if result > (10**18):
        print((-1))
        exit(0)
print(result)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
over_value = 10 ** 18 + 1
total = 1
cnt = 0
while cnt < N:
    total *= A[cnt]
    if total >= over_value:
        total = -1
    cnt += 1
    
for i in range(N):
    if A[i] == 0:
        total = 0
print(total)

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
over_value = 10 ** 18
total = 1
cnt = 0
while cnt < N:
    total *= A[cnt]
    if total > over_value:
        total = -1
        break
    cnt += 1
    
for i in range(N):
    if A[i] == 0:
        total = 0
print(total)
# Original solution
n=int(eval(input()))
ans=1
l=list(map(int,input().split()))
for x in l:
  ans=ans*x
if(ans>1000000000000000000):
  print((-1))
else:
  print(ans)

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

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

ans = 1
A.sort(reverse = True)
flag = True

if 0 in A:
    ans = 0
    flag = False

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

print(ans)
# Original solution
import sys

stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N = ni()
ans = 1
a_array = na()
for a in a_array:
    ans = ans * a
    if ans == 0:
        break
    if ans > 10 ** 18:
        ans = -1

print(ans)


# Optimized solution
import sys

stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N = ni()
ans = 1
a_array = na()
overflow = 0
for a in a_array:
    if a == 0:
        ans = 0
        break
    if not overflow:
        ans = ans * a
        if ans > 10 ** 18:
            overflow = 1
            ans = -1

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

ans = 1

p = 10 ** 18

flg = False
flg_2 = False

for a in A_list:
    ans *= a

if ans > p:
    ans = -1


print(ans)



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

ans = 1

p = 10 ** 18

for a in A_list:
    ans *= a
    if ans > p:
        ans = -1
        break

if 0 in A_list:
    print((0))
else:
    print(ans)
# Original solution
n=int(eval(input()))
li=list(map(int,input().split()))
if 0 in li:
    print((0))
    exit()
ans=1

for i in li:
    ans=ans*i

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

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

for i in li:
    ans=ans*i
    if ans>10**18:
        print((-1))
        exit()
print(ans)
# Original solution
import sys
def input():
    return sys.stdin.readline()[:-1]

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

# Optimized solution
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(eval(input()))
A = list(map(int,input().split()))
A.sort()
result = 1
for i in range(N):
    result = result * A[i]
    if result > 1e18:
        result = -1
        break
print(result)
# Original solution
N=int(eval(input()))
data=list(map(int,input().split()))
s=1
if 0 in data:
    print((0))
else:
    for f in data:
        s *= f
    if s > 10**18:
        print((-1))
    else:
        print(s)

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

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

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

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

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

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

# Optimized solution
import sys
n = int(eval(input()))
c = 1
a = list(map(int,input().split()))
ok = 0;
for i in range(0,n):
    c *= a[i]
    if c > 1000000000000000000:
        ok = 1
        break
for i in range(0,n):
    if a[i] == 0:
        ok = 0
        c = 0
if (ok):
    print((-1))
else:
    print(c)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
A = sorted(A, reverse = False)
cnt = 1

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

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


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

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

ans=1
for i in nl:
  ans = ans * i

lim = 10**18

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

# Optimized solution

def main():
  N = int(eval(input()))
  nl = list(map(int,input().split()))

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

  ans=1
  lim=10**18

  for i in nl:
    ans *= i
    if ans>lim:
      print((-1))
      return
    
  print(ans)
  
main()
# Original solution
from math import log10

def main(N):
    A = list(map(int, input().split()))
    st_A = set(A)
    if 0 in st_A:
        print((0))
    else:
        x = 1
        for a in A:
            x *= a
        if x > 10**18:
            print((-1))
        else:
            print(x)




if __name__ == '__main__':
    N = int(eval(input()))
    main(N)

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





if __name__ == '__main__':
    N = int(eval(input()))
    main(N)
# Original solution
count = int(eval(input()))
if count == 0:
  result = 0
else:
  nums_str = input().split()
  nums_int = []
  for strn in nums_str:
    nums_int.append(int(strn))

    if 0 in nums_int:
      result = 0
    else:
      result = 1
      for intn in nums_int:
        result *= intn
        if result > 1000000000000000000:
          result = -1
          break
    
print(result)

# Optimized solution
def process():
  count = int(eval(input()))
  nums_str = input().split()
  nums_int = []
  for strn in nums_str:
    nums_int.append(int(strn))

  if 0 in nums_int:
    result = 0
    return result
  else:
    result = 1
    for intn in nums_int:
      result *= intn
      if result > 1000000000000000000:
        result = -1
        return result
    return result
    
print((process()))
# Original solution
import functools
import operator
N=int(eval(input()))
A=[int(x) for x in input().split()]
result = functools.reduce(operator.mul, A)
if result>10**18:
    print((-1))
else:
    print(result)

# Optimized solution
N=int(eval(input()))
A=[int(x) for x in input().split()]
A.sort(reverse=True)
result=1
if 0 in A:
    print((0))

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

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

if __name__ == '__main__':
    try:

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

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
ans = 1
for a in A:
    ans *= a
    if ans > 1000000000000000000:
            print((-1))
            quit()
print(ans)
# Original solution
import functools
from operator import mul


n = int(eval(input()))

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

product = 1

for num in nums:
    product *= num

if product > 1e18:
    product = -1

print(product)


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

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

product = 1

for num in nums:
    product *= num

    if product > 1e18:
        product = -1
        break

if 0 in nums:
    product = 0

print(product)