CodeEff/ECCO huggingface dataset:
# Original solution
n = eval(input())

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


temp = pow(10, 18)
ans = 1
flag = 0

for i in a:
    ans = ans * i

if ans <= temp:
    print(ans)
else:
    print((-1))


# Optimized solution
n = eval(input())

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

temp = pow(10, 18)
ans = 1
flag = 0

if 0 in a:
    print((0))
    flag = 1
else:
    for i in a:
        ans = ans * i
        if ans > temp:
            print((-1))
            flag = 1
            break

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


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
result = 1
overflow = False
for i in a:
    result *= i
    if result > 1e18:
        result = 1
        overflow = True
if result != 0 and overflow:
    print((-1))
else:
    print(result)
# Original solution
def check():
  n=int(eval(input()))
  A=list(map(int,input().split()))
  if 0 in A:
    print((0))
    return
  a=1
  for i in A:
      a=a*i
  if a>1000000000000000000:
    print((-1))
    return
  print(a)
  return


check()


# 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=ans*i
   if ans>10**18:
    print((-1))
    exit()


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

MAX = 1000000000000000000
ans = 1

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

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


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

MAX = 1000000000000000000
ans = 1

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

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

if (ans > MAX) :
    print((-1))
else :
    print(ans)
# Original solution
N=int(eval(input()))
A=input().split()
answer=1
for i in range(N):
  answer=answer*int(A[i])
if answer>1*10**18:
  print((-1))
else:
  print(answer)


# Optimized solution
N=int(eval(input()))
A=input().split()
answer=1
for i in range(N):
  if int(A[i])==0:
    answer=0
for i in range(N):
  answer=answer*int(A[i])
  if answer>1*10**18:
    answer=-1
    break
print(answer)
# Original solution
from operator import mul
from functools import reduce

#while True:
N = int(eval(input()))
#	if N>=2 and N<=10**5:break

if 2 <= N <= 10**5:
	num = list(map(int, input().split()))
	ans = reduce(mul,num)
if ans > 10**18:
	print((-1))
else:
	print(ans)

# Optimized solution
def main():
    n = int(eval(input()))
    a = list(map(int,input().split()))
    if 0 in a: 
        print((0))
        return
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10**18:
            print((-1))
            return
    print(ans)
    
if __name__ =="__main__":
    main()
# Original solution
#ABC169b

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

sum = 1

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

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


# Optimized solution
#ABC169b

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

sum = 1

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

if sum > 10**18:
    print((-1))
else:
    print(sum)
# Original solution
def solve():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    ans = 1
    for num in A:
        ans *= num
    if ans > 10**18:
        ans = -1
    print(ans)

if __name__ == "__main__":
    solve()

# Optimized solution
def solve():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    ans = 1
    for i in range(N):
        if ans == -1 and A[i] != 0:
            continue
        ans *= A[i]
        if ans > 10**18:
            ans = -1
    print(ans)

if __name__ == "__main__":
    solve()
# 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((-1))
    exit()

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=[int(x) for x in input().split()]
ans=1
for i in range(0,N):
    ans=ans*A[i]
if ans>1000000000000000000:
    ans=-1
print(ans)


# Optimized solution
N=int(eval(input()))
A=[int(x) for x in input().split()]
ans=1
if 0 in A:
    ans=0
else:
    for i in range(0,N):
        ans=ans*A[i]
        if ans>1000000000000000000:
            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("-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")
        exit()

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

pro = 1

for i in a:
    pro = pro * i

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

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

pro = 1

if 0 in a:
    pro = 0
else:
    for i in a:
        if pro > 10 ** 18:
            pro = -1
            break
        else:
            pro = pro * i

if pro > 10 ** 18:
    print((-1))
else:
    print(pro)
# Original solution
n = int(eval(input()))
a = input().split(" ")

sum = 1
for i in a:
  sum = sum * int(i)

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

# Optimized solution
n = int(eval(input()))
a = input().split(" ")

sum = 1
for i in a:
  sum = sum * int(i)
  if sum > 1000000000000000000:
    break

if "0" in a:
  print((0))
elif sum > 1000000000000000000:
  print((-1))
else:
  print(sum)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
pdt = 1
for i in range(n):
  pdt *= a[i]
if pdt>10**18:
  print((-1))
else:
  print(pdt)

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

n = sys.stdin.readline()
l = list(map(int, sys.stdin.readline().split()))
tmp = 1000000000000000000

ans = 1
for i in l:
    if i == 0:
        ans = 0
        break

    ans *= i

if ans <= 1000000000000000000:
    print(ans)
else:
    print((-1))


# Optimized solution
import sys

n = sys.stdin.readline()
l = list(map(int, sys.stdin.readline().split()))
tmp = 1000000000000000000

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

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

if a.count("0"):
 print((0))
 exit()
 
for i in range(n):
 ans=ans*int(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 i in a:
    ans *= i

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

print(ans)


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

for i in a:
    if i == 0:
        print((0))
        exit()

ans = 1
for i in a:
    ans *= 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 x in A:
    ans *= x

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


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

A = list(map(int,input().split(" ")))
flag = 0
ans = 1

if 0 in A:
    flag = 2
    print((0))

if flag != 2:
    for x in A:
        ans *= x
        #print(ans)
        if ans > 10**18:
            flag = 1
            break

if flag == 0:
    print(ans)
elif flag == 1:
    print("-1")
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))

result=1

if 0 in A:
    result=0
else:
    for i in range(N):
        result = result*A[i]

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

# Optimized solution
import sys
n = eval(input())
list_num =list(map(int,input().split()))
output = 1
if 0 in list_num:
    print((0))
    sys.exit()
for i in list_num:
    output = output * i
    if output > 10 ** 18:
        print((-1))
        sys.exit()
print(output)
# Original 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 = result*i
if result > 10**18:
    result=-1
print(result)


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

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

def judge(A):
  for i in range(len(A)):
    if A[i] == 0:
      print((0))
      return
  result = 1
  for i in range(N):
    result = result * A[i]
    if result > 1000000000000000000:
      print((-1))
      return
  if result <= 1000000000000000000:
    print(result)
    return
  
judge(A)
# Original solution
N = int(eval(input()))
sum = 1
for num in input().split():
    sum *= int(num)
    if sum == 0:
        print((0))
        exit()
if len(str(sum)) > 19:
    print((-1))
    exit()
elif len(str(sum)) == 19:
    if str(sum).count("1") == 1 and str(sum).count("0") == 18:
        pass
    else:
        print((-1))
        exit()
print(sum)


# Optimized solution
N = int(eval(input()))
sum = 1
keta = 0

numbers = input().split()
if not ("0" in numbers):
    for num in numbers:
        keta += len(num) - 1
        if keta > 19:
            print((-1))
            exit()
        sum *= int(num)
        if len(str(sum)) > 19:
            print((-1))
            exit()
        
    if len(str(sum)) == 19:
        if str(sum).count("1") == 1 and str(sum).count("0") == 18:
            pass
        else:
            print((-1))
            exit()
else:
    print((0))
    exit()
print(sum)
# Original solution
N = int(eval(input()))

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

ans = 1
for x in A:
  ans *= x
  if ans < 0:
    print((-1))
    exit()

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


print(ans)


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

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

ans = 1
keta = 0
if 0 in A:
  print((0))
  exit()

for x in A:
  ans *= x
  keta += len(str(x))
  if ans > 1000000000000000000:
    print((-1))
    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:
    ans = -1

print(ans)


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

for i in a:
    ans *= i
    if ans > 10**18:
        ans = -1
        break

if a.count(0) > 0:
    ans = 0

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

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

if __name__ == '__main__':
    for i in l:
        total *= i
        if total > 1000000000000000000:
            total = -1
            break

    if 0 in l :
        total = 0
    print(total)
# 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()))
a = sorted(a)
#print(a)
ans = 1
if a.count(0):
    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=input().split()
a=list(map(int,a))
i=0
ans=1
if(n==0):
    print((0))
    exit()
elif(len(a)==0):
    print((0))
    exit()
for calc in a:
    if(0 in a):
        print((0))
        exit()
    ans=ans*calc
    if(ans>1000000000000000000):
        print((-1))
        exit()
    i+=1
    if(i==n):
        break
if(ans>1000000000000000000):
    print((-1))
else:
    print(ans)


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

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

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

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

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

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

if 0 in ls:
  print('0')
  exit()

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

  if goukei > 1000000000000000000:
    print('-1')
    exit()

print((int(goukei)))
# Original solution
n = int(eval(input()))
ret = 1
a = list(map(int, input().split()))
for ai in a:
    ret *= ai
if ret > 1000000000000000000:
    print((-1))
else:
    print(ret)


# Optimized solution
n = int(eval(input()))
ret = 1
a = sorted(list(map(int, input().split())))
for ai in a:
    ret *= ai
    if ret > 1000000000000000000:
        print((-1))
        exit(0)
print(ret)
# Original solution
import functools
import operator

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

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

# Optimized solution
ans = 1
flag = 0

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

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

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

if nums.count(0) > 0:
  ans = 0
else:
  for i in range(n):
    ans *= nums[i]
    if ans > 10**18:
      ans = -1
      break

print(ans)
# Original solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()


def resolve():
    n = int(input().rstrip())
    a_list = list(map(int, input().split()))

    ans = 1

    for i in a_list:
        ans *= i

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


if __name__ == "__main__":
    resolve()



# Optimized solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()


def resolve():
    n = int(input().rstrip())
    a_list = list(map(int, input().split()))
    flag = False
    try:
        if a_list.index(0):
            flag = True
            print((0))
            exit()
    except:
        if flag:
            exit()
        ans = 1
        for i in a_list:
            ans *= i

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

        print(ans)



if __name__ == "__main__":
    resolve()
# Original solution
n = int(eval(input()))
A = input().split(sep=' ')
pro = 1
for el in A:
	pro *= int(el)

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

# Optimized solution
n = int(eval(input()))
A = list(map(int, input().split()))
if 0 in A:
    print((0))
else:
    pro = 1;
    ok = True
    for el in A:
        pro *= el
        if(pro > 1e18):
            ok = False
            break

    if ok: print(pro)
    else: print((-1))
# Original solution
n = int(eval(input()))
la = list(map(int, input().split()))
import functools
import operator

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

# Optimized solution
def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default
      
n = int(eval(input()))
la = list(map(int, input().split()))
import sys
if my_index(la, 0) > 0:
  print((0))
  sys.exit()

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

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

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

ans = 1
flag = False
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()))

if 0 in a:
    print((0))
else:
    ans = 1
    flag = False
    for i in range(n):
        ans = ans * a[i]
        if ans > 10**18:
            flag = True
            break

    if flag:
        print((-1))
    else:
        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:
  ans=-1
print(ans)


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

pyn()
# Original solution
num = eval(input())
input_data = input().split()

result = 1
for i in range(int(num)):
  result = result * int(input_data[i])

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

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

for i in input_data:
	if i == 0:
		print((0))
		exit()

result = 1
for i in range(num):
	result = result * int(input_data[i])
	if pow(10, 18) < result:
		print((-1))
		exit()

print(result)
# Original solution
N=int(eval(input()))

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

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

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

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

ans=1
if 0 in A:
    ans=0
else:
    for a in A:
        ans=ans*a
        if ans > 10**18:
            ans=-1
            break

print(ans)
# Original solution
from operator import mul
from functools import reduce

N = int(eval(input()))
x = [int(i) for i in input().split()]
y = reduce(mul, x)

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

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

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

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

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

num = 1

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

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

print(num)
# Original solution
n = int(eval(input()))

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

result = 1

for x in a:
    result *= x

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

print(result)

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

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

result = 1

if 0 in a:
    result = 0
else:
    for x in a:
        result *= x
        if result > 10 ** 18:
            result = -1
            break

print(result)
# Original solution
import sys

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

ans = 1
for a in a_list:
  if a == 0:
    print((0))
    sys.exit()
  
  if a > 1000000000000000000:
    print((-1))
    sys.exit()
  
  ans *= a
 
if ans > 1000000000000000000:
  print((-1))
else:
  print(ans)


# Optimized solution
import sys

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

if a_list[-1] == 0:
  print((0))
  sys.exit()

if a_list[0] > 1000000000000000000:
  print((-1))
  sys.exit()

ans = 1
for a in a_list:
  ans *= a

  if ans > 1000000000000000000:
    print((-1))
    sys.exit()

print(ans)
# Original solution
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

    INF = 10 ** 18

    res = 1

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

    if res > INF:
        res = -1

    print(res)



main()


# Optimized solution
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
# from numba import njit


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

    Aset = set(A)

    if 0 in Aset:
        print((0))
        sys.exit()

    A.sort(reverse=True)

    res = 1
    INF = 10 ** 18

    for i in range(N):
        res *= A[i]
        if res > INF:
            res = -1
            break

    print(res)



main()
# Original solution
n = int(eval(input()))
lt=input().split(" ")
ans=1
for i in range(n):
    ans*=int(lt[i])
if(ans<=10**18):
    print(ans)
else:
    print((-1))

# Optimized solution
n = int(eval(input()))
A = [*list(map(int,input().split()))]
ok = 0
ans = 1
lim = 10**18
for i in range(n):
  ans *= A[i]
  if(ans>lim):
      ok =1
      break
if(ok and 0 not in A):
    print((-1))
elif(0 in A):
    print((0))
else:
    print(ans)
# Original solution
n=int(eval(input()))
a_list=list(map(int,input().split()))
ans=a_list[0]
for i in range(1,n):
    ans*=a_list[i]
if ans>10**18:
    ans=-1
        
print(ans)
        

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

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

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

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