CodeEff/ECCO huggingface dataset:
# Original solution
n=int(eval(input()))
A=list(map(int,input().split()))
x=1
flag=1
for i in range(n):
  if A[i]==0:
    print((0))
    exit()
  else:
    x*=A[i]

if x>10**18:
  flag=0
  

if flag==1:
  print(x)
else:
  print("-1")

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

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

print(x)
# Original solution
import sys

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

n = int(readline())
a = list(map(int, readline().split()))

t = 1

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

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


# Optimized solution
import sys

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

n = int(readline())
a = list(map(int, readline().split()))

t = 1

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

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

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


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

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

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()))
res = 1
for a_i in a:
    if 0 == a_i:
        print((0))
        exit(0)
    elif res > 10 ** 18:
        res = -1
    else:
        res *= a_i

print((-1 if res > 10 ** 18 else res))


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
res = 1
for a_i in a:
    if 0 == a_i:
        print((0))
        exit(0)
    elif res > 10 ** 18:
        continue
    else:
        res *= a_i

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



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

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

ans = 1

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



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

else:
    print(ans)

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

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

flag = 0

for i in range (N):
    if pre[i] == 0:
        flag = 1

if flag == 0:

    ans = 1

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

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

    if ans <= 10**18:
        print(ans)

else:
    print("0")
# Original solution
t = int(eval(input()))
list_v = [int(x) for x in input().split()]

res = 1
for v in list_v:
  res = res * v
 
if res > 1000000000000000000:
	print((-1))
else:
	print(res)

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


# Optimized solution
n=int(eval(input()))
a=list(map(int,(input().split())))
l=1
a=sorted(a)
for i in range(n):
    l*=a[i]
    if l>10**18:
        print('-1')
        exit()
print(l)
# Original solution
# -*- coding: utf-8 -*-
import sys

# スペース区切りの整数の入力
N, *d = list(map(int, open(0).read().split()))
A = 1

for O in d:
    A = A*O

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

print(A)

# Optimized solution
def main():
# スペース区切りの整数の入力
	N, *d = list(map(int, open(0).read().split()))

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

	A = 1
	for O in d:
		A *= O
		#print(O)
		if A > 1000000000000000000:
			print((-1))
			return

	print(A)

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

ans = 1

for i in num_list:
    ans *= i

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

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

ans = 1

if 0 in num_list:
    print((0))
else:
    for i in num_list:
        ans *= i
        if ans > 10**18:
            print('-1')
            break

    if ans<= 10**18:
        print(ans)
# Original solution
import math
from functools import reduce

n = int(eval(input()))
A = [None]*n
A = list(map(int, input().split()))
T = reduce((lambda x, y: x * y), A)
if T > pow(10,18):
    print((-1))
else:
    print(T)



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

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

print(ans)

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


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

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


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

ans = 1
if a.count(0) > 0:
    ans = 0
else:
    for i in range(n):
        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 a:
	ans *= i
if ans <= 10**18:
	print(ans)
else:
	print((-1))

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

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

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

print(ans)
# Original solution
p = 10 ** 18

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

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

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

# Optimized solution
p = 10 ** 18

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

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

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


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

print(ans)

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

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A = sorted(A,reverse=True)
B = 1
if 0 in A:
    print((0))
    quit()
else:
    for i in A:
        B *= i
        if B> 10**18:  
            print((-1))
            quit()
print(B)
# Original solution
N = int(eval(input()))
A = input().split()
answer = 1
flag = 0
x = 10**18
for i in range(N):
  A[i] = int(A[i])
  answer *= A[i]
  if answer == 0:
    break

check = answer/x
if ((check) >= 1) and (answer != x):
  print((-1))
else:
  print(answer)

# Optimized solution
N = int(eval(input()))
A = input().split()
answer = 1
flag = 0
x = 10**18

if '0' in A:
  print((0))
  flag = 1
  


if flag == 0:
  for i in range(N):
    answer *= int(A[i])
    if answer > x:
      print((-1))
      flag = 1
      break

if flag == 0:    
  print(answer)
# Original solution
MAX_NUM = 10 ** 18

def main():
    import math
    N = int(eval(input()))
    A = list(map(int, input().split()))
    ans = 1
    for i in range(N):
        ans = ans * A[i]
        
        if(ans > MAX_NUM):
            ans = -1
            if(A[i] == 0):
                ans = 0
                break

    print(ans)



main()

# Optimized solution
MAX_NUM = 10 ** 18

def main():
    import math
    N = int(eval(input()))
    A = list(map(int, input().split()))
    A_set = set(A)
    log_sum = 0
    if(0 in A_set):
        print("0")
        return
    
    A_log = [0] * N
    ans = 1
    for i in range(N):
        log_sum += math.log10(A[i])
        if(log_sum > 18):
            ans = -1
            break
        else:
            ans = ans * A[i]
            if(ans > MAX_NUM):
                ans = -1
                break
    print(ans)



main()
# Original solution
# -*- coding: utf-8 -*-

n = int(eval(input()))
num = list(map(int, input().split()))
ans = 0
flg = 0
for i in range(n):
    if num[i] == 0:
        flg = 1;
        break
    
for i in range(n):
    if i == 0:
        ans = num[0]
    else:
        ans*=num[i]
    
    if ans > 10 ** 18 and flg ==0:
        print((-1))
        break
    

if ans <= 10 ** 18:
    print(ans)

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

n = int(eval(input()))
num = list(map(int, input().split()))
ans = 0
flg = 0
for i in range(n):
    if num[i] == 0:
        flg = 1;
        break
    
for i in range(n):
    if flg == 1:
        print((0))
        break
    elif i == 0:
        ans = num[0]
    else:
        ans*=num[i]
    
    if ans > 10 ** 18 and flg ==0:
        print((-1))
        break
    

if ans <= 10 ** 18 and flg == 0:
    print(ans)
# Original solution
from sys import stdin

def main():

    input = stdin.readline

    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)


if __name__ == "__main__":
    main()

# Optimized solution
from sys import stdin

def main():

    input = stdin.readline

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

    over_num = 10 ** 18

    ans = 1

    if A.count(0) > 0:
        print("0")
        return

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

    print(ans)


if __name__ == "__main__":
    main()
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1
flag = 0
for i in range(n):
    ans = ans * a[i]
    if a[i] == 0:
        ans = 0
        break


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


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

# Optimized solution
N = int(eval(input()))
lis = list(map(int,input().split()))
a = 1
tf = True
zero = False
for k in range(N):
  if lis[k] == 0:
    zero = True
if not zero:
  for i in range(N):
    a *= lis[i]
    if a > 10**18:
      tf = False
      break
if zero:
  print((0))
else:
  if tf:
    print(a)
  else:
    print('-1')
# Original solution
t=1
for a in sorted([*open(0)][1].split()):t=(-1,t:=t*int(a))[0<=t<=1e18]
print(t)

# Optimized solution
t=1
for a in[*open(0)][1].split():t=(-1,t:=t*int(a))[0<=t<=1e18]
print(t)
# Original solution
import functools
import operator
n = int(eval(input()))
A = list(map(int, input().split()))
ans = functools.reduce(operator.mul, A)

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

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


print(ans)
# Original solution
from operator import add,mul,sub,truediv,floordiv
from functools import reduce

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

mul = reduce(lambda x,y:x*y, A)
if mul > 10**18:
    print('-1')
else:
    print(mul)

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

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

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

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

if 0 in c:
  print('0')
  sys.exit()

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


# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=a[0]
i=1
if 0 in a:
    ans=0
else:
    while i<n:
        ans*=a[i]
        i+=1
        if ans>1000000000000000000:
            ans=-1
            break
print(ans)
# Original solution
from operator import mul
from functools import reduce

N = int(eval(input()))
A = [int(i) for i in input().split(' ')]
if 0 in A:
    print((0))
else:
    goal = reduce(mul, A)
    if goal <= 10**18:
        print(goal)
    else:
        print((-1))

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
if 0 in A:
    print((0))
else:
    answer = A[0]
    for i in range(N-1):
        answer *= A[i+1]
        if answer > 10**18:
            print((-1))
            break
    else:
        print(answer)
# Original solution
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

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



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

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

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

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

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

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

# Optimized solution
import sys

N = int(eval(input()))
h = list(map(int, input().split()))
c = 1
if 0 in h:
    print((0))
    sys.exit()
for i in range(0, len(h)):
    c *= h[i]
    if c > 10**18:
        print((-1))
        sys.exit()
print(c)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
S = 1
for i in range(N):
    S *= A[i]
if S > 100 ** 9:
    print("-1")
else:
    print(S)

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
S = 1
if 0 in A:
    print("0")
    exit()
    
for i in range(N):
    S *= A[i]
    if S > 1000000000000000000:
        print("-1")
        exit()

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


# Optimized solution
N = int(eval(input()))
A = [int(x) for x in input().split()]
U = 10**18

def main(A):
    a = 1
    for x in A:
        if x == 0:
            return 0
    for x in A:
        a *= x
        if a > U:
            return -1
    return a

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


# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
a.sort()
s = 1
for i in a:
    s *= i
    if s>10**18:
        print((-1))
        exit()
else:
    print(s)
# Original solution
n = int(eval(input()))
arr = list(map(int,input().split()))
res = 1
for i in range(n):
  res = res*arr[i]
inf = int(1e18)
if(res > inf):
  print((-1))
else:
  print(res)

# Optimized solution
n = int(eval(input()))
arr = list(map(int,input().split()))
res = 1
flag = 1
arr.sort()
inf = int(1e18)
for i in range(n):
  res = res*arr[i]
  if(res > inf):
    flag = 0
    break
 
if(flag == 0):
  print((-1))
else:
  print(res)
# Original solution
n = int(eval(input()))
a = [int(i) for i in input().split()]

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

if(kotae > 10 ** 18):
    kotae = -1

print(kotae)

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

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

print(kotae)
# Original solution
N=int(input())
A=list(map(int, input().split()))
ans=1
flag=True
for i in range(len(A)):
  ans*=A[i]

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

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

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

# 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:
        ans = -1
        break
print(ans)
# Original solution
n = int(eval(input()))
lis = list(map(int,input().split()))
a = 1
for i in range(n):
    a = a*lis[i]

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

# Optimized solution
n = int(eval(input()))
lis = list(map(int,input().split()))
a = 1
i = 0
while a<= 10**18 and i <=n-1:
    a = a*lis[i]
    i = i + 1

if 0 in lis:
    print((0))
elif a > 10**18:
    print("-1")
else:
    print(a)
# Original solution
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return list(map(int, sys.stdin.readline().split()))
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

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

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

# Optimized solution
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return list(map(int, sys.stdin.readline().split()))
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
A = li()
ans = 1
for num in A:
    ans *= num
    if ans > 10**18:
        if 0 in A:
            print((0))
        else:
            print((-1))
        exit()

print(ans)