CodeEff/ECCO huggingface dataset:
# Original solution
from math import log10 as log

N = int(eval(input()))
A = [int(a) for a in input().split()]
if min(A) == 0:
    B = [0]
else:
    B = [log(b) for b in A]

ans = 1
if sum(B) > 18:
    ans = -1
else:
    for a in A:
        ans *= a
if ans > 10 **18:
    ans = -1
print(ans)


# Optimized solution
from math import log10 as log

N = int(eval(input()))
A = [int(a) for a in 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
N=int(eval(input()))
M=[int(_) for _ in input().split()]
a=1
for s in M:
    a=a*s
if a>10**18:
    print((-1))
else:print(a)

# Optimized solution
N=int(eval(input()))
M=[int(_) for _ in input().split()]
M.sort(reverse=True)
a=1
if M[-1]==0:
    print((0))
    exit()

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

# Optimized solution
from sys import exit
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
A.sort(reverse=True)
if A[-1] == 0:
  print((0))
  exit()
for a in A:
  ans *= a
  if ans > 10 ** 18:
    print((-1))
    exit()
print(ans)
# Original solution
n = int(eval(input()))
a = [int(x) for x in input().split()]

M_NUM = 10**18

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

if ans > M_NUM:
    print('-1')
else:
    print(ans)


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

M_NUM = 10**18

ans = 1
for item in a:
    if ans > M_NUM:
        break
    ans *= item

if 0 in a:
    print('0')
elif ans > M_NUM:
    print('-1')
else:
    print(ans)
# Original solution
#!/usr/bin/env python3
n = int(eval(input())) 
A = list(map(int, input().split()))
i = 10 ** 18
ans = 1
for a in A:
    ans = ans * a
if ans > i:
    print((-1))
else:
    print(ans)

# Optimized solution
#!/usr/bin/env python3
n = int(eval(input())) 
A = list(map(int, input().split()))
b = 1
i = 10**18
A = sorted(A)
for a in A:
  if b > i:
    break
  b *= a
print((-1 if b > i else b))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

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

# Optimized solution
n = int(eval(input()))
num = list(map(int, input().split()))
limit = 10**18
 
num.sort()
result = num[0]

if result == 0:
    print((0))
else:
    for i in num[1:]:
        result *= i
        if result > limit:
            print((-1))
            exit()

    print(result)
# Original solution
def main():
  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)
  
main()


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

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
m =  10**18 
ans = 1
A.sort()
for i in range(N):
  ans *= A[i]
  if ans > m:
    print((-1))
    exit(0)
  if ans == 0:
    break;
#
print(ans)
#
# Original solution
def sol():
    n = int(eval(input()))
    mul = 1
    arr = list(map(int, input().split()))
    for i in arr:
        mul*=i
    if(mul>10**18):
        print((-1))
    else:
        print(mul)
sol()

# Optimized solution
def sol():
    n = int(eval(input()))
    mul = 1
    arr = list(map(int, input().split()))
    arr.sort()
    for i in arr:
        mul*=i
        if(mul>10**18):
            print((-1))
            return
    print(mul)
sol()
# Original solution
eval(input())
a=list(map(int,input().split()))
s=1
for i in a:
    s*=i
print((s if s<=10**18 else -1))

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

res = reduce(lambda x,y: x*y, a)
if res > m:
    print((-1))
else:
    print(res)

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

print(res)
# Original solution
def multiplyList(myList) : 
      
    # Multiply elements one by one 
    result = 1
    for x in myList: 
         result = result * x
         if result == 0:
             return 0
    return result

n = int(eval(input()))
l = list(map(int, input().split()))
res = multiplyList(l)
if(res > 10**18):
    print((-1))
else:
    print(res)


# Optimized solution
def multiplyList(myList) : 
      
    # Multiply elements one by one 
    result = 1
    for x in myList: 
        result = result * x
        if result == 0:
             return 0 
        if result > 10**18:
             return -1
    return result
 
n = int(eval(input()))
l = list(map(int, input().split()))
l.sort()
res = multiplyList(l)
print(res)
# Original solution
import sys
input = sys.stdin.readline

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

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

if __name__ == '__main__':
    main()

# Optimized solution
import sys
input = sys.stdin.readline

def main():
    N = int(eval(input()))
    A = sorted([int(v) for v in input().split()])

    over = False
    ans = 1
    for a in A:
        ans *= a
        if ans > 1e18:
            over = True
            break
    
    if over:
        print((-1))
    else:
        print(ans)

if __name__ == '__main__':
    main()
# Original solution
_,a=open(0)
t=1
for b in a.split():t*=int(b)
print((-~t*(t<=10**18)-1))

# Optimized solution
_,a=open(0)
t=1
for b in sorted(a.split()):
 t*=int(b)
 if t>10**18:t=-1;break
print(t)
# Original solution
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
res = 1
for i in range(n):
    res *= li[i]
print(res) if res <= 10**18 else print(-1)


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

for a in A:
  if a == 0:
    prod == 0

for a in A:
  prod *= a

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

print(prod) 

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

  for a in A:
    if a == 0:
      print((0))
      return

  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print((-1))
      return

  print(prod) 

main()
# Original solution
N=int(eval(input()))
T=1e18
arr=[int(i) for i in input().split()]
A=1
for a in arr:
    A*=a

print((A if A<=T else -1))


# Optimized solution
N=int(eval(input()))
T=1e18
arr=[int(i) for i in input().split()]
A=1
for a in arr:
    A*=a
    if A<0:
        A=-1
    if A>T:
        A=-1
print(A)
# Original solution
import sys
input = sys.stdin.readline

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

ans = 1
max = 1000000000000000000
for i in range(len(N)):
  ans = ans * N[i]

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

# Optimized solution
import sys
input = sys.stdin.readline

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

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

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

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

if 0 in A:
  print((0))
  exit()
for a in A:
  mult *= a
  if mult > 1e18:
    print((-1))
    exit()
print(mult)
# Original solution
N = int(eval(input()))
nums = input().split()
mul = int(nums[0])
for i in nums[1:]:
    mul *= int(i)
if mul > 10**18:
    mul = -1
print(mul)

# Optimized solution
N = int(eval(input()))
nums = input().split()
mul = int(nums[0])
if str(0) in nums:
    mul = 0
else:
    for i in nums[1:]:
        mul *= int(i)
        if len(str(mul)) >= 19 and str(mul) != "1000000000000000000":
            mul = -1
            break
print(mul)
# Original solution
def main():
    n = int(eval(input()))
    a = list(map(int,input().split()))
    s = 1
    for i in range(n):
        s *= a[i]
    if s>10**18:
        print((-1))
        return
    print(s)

if __name__ == "__main__":
    main()


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

if __name__ == "__main__":
    main()
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

ans = 1

for a in A:
    ans *= a
if ans > pow(10, 18):
    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 *= a
        if ans > pow(10, 18):
            ans = -1
            break
print(ans)
# Original solution
from operator import mul
from functools import reduce

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

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
anser = 1
if 0 in A:
    print("0")
    exit()
for i in A:
    anser *= i
    if anser > 10 ** 18:
        print("-1")
        exit()
print(anser)
# Original solution

a=int(eval(input()))
b=list(map(int, input().split()))
c=1
d=0
if 0 in b:
    d=1
for i in range(a):
    c*=b[i]
    if d!=1 and c>10**18:
        print((-1))
        exit()


print(c)


# Optimized solution

a=int(eval(input()))
b=list(map(int, input().split()))
c=1
d=0
if 0 in b:
    print((0))
    exit()
for i in range(a):
    c*=b[i]
    if c>10**18:
        print((-1))
        exit()


print(c)
# Original solution
import sys

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

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

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


# Optimized solution
import sys

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

for val in a:
    if val == 0:
        print("0")
        exit(0)

ans = 1
for val in a:
    ans *= val
    if ans > 1000000000000000000:
        print("-1")
        exit(0)

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


# Optimized solution
import sys
n =int(eval(input()))
a = list(map(int,input().split()))
if a.count(0) >0:
    print((0))
    sys.exit()
b = 1
for i in range(n):
    b *= a[i]
    if b> 10**18:
        print("-1")
        sys.exit()
print(b)
# Original solution
n = int(eval(input()))
arr = list(map(int,input().split()))
ans = 1
for i in arr:
    ans *= i
print((ans if ans <= 10**18 else -1))

# Optimized solution
n = int(eval(input()))
arr = list(map(int,input().split()))
ans = 1
if 0 in arr:
    print((0))
    exit()
for i in arr:
    ans *= i
    if ans > 10**18:
        print((-1))
        exit()
print((ans if ans <= 10**18 else -1))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans = ans*i
if ans > 1000000000000000000:
    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
    for i in a:
        ans = ans*i
        if ans > 1000000000000000000:
            print((-1))
            ans = -1
            break
    if ans != -1:
        print(ans)
# Original solution
#!/usr/bin/env python3


def main():
    MOD = 10 ** 18
    n = int(eval(input()))
    A = list(map(int, input().split()))
    ans = 1
    for a in A:
        ans *= a

    if ans <= MOD:
        print(ans)
    else:
        print('-1')


if __name__ == "__main__":
    main()


# Optimized solution
#!/usr/bin/env python3


def main():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    MOD = 10 ** 18
    ans = 1
    if 0 in A:
        print('0')
        return
    for i in range(n):
        ans *= A.pop(0)
        if ans > MOD:
            print('-1')
            return
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
num = 1
for i in range(0,N):
    if A[i]==0:
      	num=0
      	break
for i in range(0,N):
    if num>10**18:
        break
    else:
        num *=A[i]
if num>10**18:
    print((-1))
else:
    print(num)

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

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

Ans = 1
for i in range(0,len(A)):
    Ans *= A[i]
    if Ans > 10**18:
        print((-1))
        exit()
    else:
        continue
print(Ans)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
t = A[0]
i = 1
while i < N:
    t *= A[i]
    i += 1
if t <= 1e18:
    print(t)
else:
    print((-1))


# Optimized solution
#import numpy as np
N = int(eval(input()))
A = list(map(int, input().split()))
#A = np.array(A)
t = A[0]
for i in range(1,N):
    t *= A[i]
    if int(t) > 1e18:
        for j in range(i,N):
            if A[j] == 0:
                t = 0
        break
if int(t) <= 1e18:
    print((int(t)))
else:
    print((-1))
# Original solution
N = int(eval(input()))
A = tuple(map(int, input().split()))
MAX = 10 ** 18
ans = A[0]
for a in A[1:]:
    ans *= a
if ans > MAX:
    print((-1))
else:
    print(ans)

# Optimized solution
N = int(eval(input()))
A = sorted(map(int, input().split()))
MAX = 10 ** 18
ans = A[0]
for a in A[1:]:
    ans *= a
    if ans > MAX:
        ans = -1
        break
print(ans)
# 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((str(-1)))
else:
    print(ans)

# Optimized solution
import sys

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

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

for a in A:
    ans *= a
    if ans > 10 ** 18:
        print((str(-1)))
        break
else:
    print(ans)
# Original solution
import sys

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

from operator import mul
from functools import reduce

""" Input
S = input().rstrip()
N, A, B = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(input().split(), dtype=np.float64)
D = [int(input()) for _ in range(N)]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
"""

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

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


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

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

A = sorted(A)

total = A[0]
limit = 10 ** 18

for a in A[1:]:
    total *= a
    if total > limit:
        print((-1))
        exit()
print(total)
# Original solution
import sys

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

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

A = sorted(A)

total = A[0]
limit = 10 ** 18

for a in A[1:]:
    total *= a
    if total > limit:
        print((-1))
        exit()
print(total)


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

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

limit = 10 ** 18
A = sorted(A)

total = A[0]
if total == 0:
    print(total)
    exit()

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


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

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

sum = 1
for i in n1:
    sum *= i

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

# Optimized solution
def main():
    n = int(eval(input()))

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

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

    sum = 1
    for i in n1:
        sum *= i
        if sum > 1000000000000000000:
            print((-1)) 
            return 
    print(sum)

main()
# Original solution
num = int(eval(input()))
a_i = list(map(int, input().split()))
ans = 1
for x in a_i:
    ans *= x
if ans > 10 ** 18: print((-1))
else: print(ans)

# Optimized solution
num = int(eval(input()))
a_i = list(map(int, input().split()))
ans = 1
if a_i.count(0) > 0: print((0))
else:
    for x in a_i:
        ans *= x
        if ans > 10 ** 18: 
            ans = -1
            break
    print(ans)
# Original solution
from functools import reduce
from operator import add, mul

a = [1, 2, 3, 4] # 適当なリスト

N = int(eval(input())) # 1行, 単数
arg = list(map(int, input().split())) # 1行, 配列

m = reduce(mul, arg)
 
if m - 1000000000000000000 > 0:
  print((-1))
else:
  print(m)


# Optimized solution
# import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()


N = int(eval(input())) # 1行, 単数

arg = list(map(int, input().split())) # 1行, 配列
m = 1

if 0 in arg:
  print((0))
else:
  for A in arg:
    m = A * m
    if m > 1000000000000000000:
      m = -1
      break;
  print(m)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1
if 0 in a:
    ans = 0
else:
    for i in a:
        ans *= i
        if ans > 1000000000000000000:
            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 i in a:
        ans *= i
        if ans > 1000000000000000000:
            ans = -1
            break
print(ans)
# Original solution
n=int(eval(input()))
c=1
f=1
a=list(map(int,input().split()))
for i in range(0,n):
  if a[i]==0:
    f=1
    c=0
    break
  if c*a[i]>1e18 or f==0:
    c*=a[i]
    f=0
    continue
  c*=a[i]
if f==0: print((-1))
else: print(c)

# Optimized solution
n=int(eval(input()))
c=1
f=1
a=list(map(int,input().split()))
for i in range(0,n):
  if a[i]==0:
    f=1
    c=0
    break
  if f==0: continue
  if c*a[i]>1e18:
    c*=a[i]
    f=0
    continue
  c*=a[i]
if f==0: print((-1))
else: print(c)
# Original solution
n = int(eval(input()))
a = [int(x) for x in input().split()]
ans = 1
flag = False
zeros = False
over = pow(10,18)
for i in a:
    ans *= i
    if (ans > over):
        flag = True
    if i == 0:
        zeros = True

if (flag):
    ans = -1
if (zeros):
    ans = 0

print(ans)




# Optimized solution
n = int(eval(input()))
a = [int(x) for x in input().split()]
ans = 1
flag = False
zeros = False
over = pow(10,18)
for i in a:
    if flag == False:
        ans *= i
    if (ans > over):
        flag = True
    if i == 0:
        zeros = True

if (flag):
    ans = -1
if (zeros):
    ans = 0

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

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

print(ans)
# Original solution
# your code goes here
n = int(eval(input("")))
a = input("").split()
res = 1
for e in range(n):
	res *= int(a[e])
if res > 1000000000000000000:
	print((-1))
else:
	print(res)

# Optimized solution
# your code goes here
n = int(eval(input()))
a = input().split()
res = 1
zero = 0
for e in range(n):
	if int(a[e]) == 0:
		zero = 1
for e in range(n):
	res *= int(a[e])
	if res > 1000000000000000000:
		break
if zero == 1:
	print((0))
elif res > 1000000000000000000:
	print((-1))
else:
	print(res)
# Original solution
N = int(eval(input()))
A = [i for i in map(int, input().split())]

As = 1
for i in range(N):
    As = As*A[i]
if 1000000000000000000 < As:
    print((-1))
else:
    print(As)

# Optimized solution
N = int(eval(input()))
A = [i for i in map(int, input().split())]

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

    if As <= 10**18:
        print(As)
# Original solution
a = int(eval(input()))
b = input().split(" ")
i = 0
s = 1
while i < a :
    s = s * int(b[i])
    i = i + 1
if s > (10 ** 18) :
    print("-1")
else:
    print(s)

# Optimized solution
a = int(eval(input()))
b = input().split(" ")
i = 0
s = 1
f = 0
while i < a :
    if b[i] == "0" :
        print((0))
        f = f + 1
    i = i + 1
i = 0
while (i < a) and f == 0 :
    s = s * int(b[i])
    i = i + 1
    if s > (10 ** 18):
        print("-1")
        break
    if (s <= 10 ** 18) and (i == a):
        print(s)
# Original solution
import sys
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
LIMIT = 10 ** 18
n=int(eval(input()))
#a=(int,read.split())
a=[int(i) for i in input().split()]
if 0 in a:
	print((0))
	exit()

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

# Optimized solution
n=int(eval(input()))
a=[int(i) for i in input().split()]
result=1
if 0 in a:
	print((0))
	exit()
for i in range(n):
	result *= a[i]
	if result > 1000000000000000000 and a[i] != 0:
		print((-1))
		exit()
print(result)
# Original solution
n = int(eval(input()))

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

#print(A)

flag = 0
b = 1

for a in A:
  if a == 0:
    flag = 2

if flag == 0:
  for a in A:
    b = b * a

if(b > 10**18):
  flag = 1
  
  
if flag == 1:
  print((-1))
elif flag == 0:
  print(b)
else:
  print((0))


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

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

#print(A)

flag = 0
b = 1

for a in A:
  if a == 0:
    flag = 2

if flag == 0:
  for a in A:
    b = b * a
    if(b > 10**18):
      flag = 1
      break

#if(b > 10**18):
#  flag = 1
  
  
if flag == 1:
  print((-1))
elif flag == 0:
  print(b)
else:
  print((0))