CodeEff/ECCO huggingface dataset:
# 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 > 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 :
    ans = 0
    print((0))
else:
    for i in a :
        ans *= i
        if ans > 10**18:
            print((-1))
            break
    else:
        print(ans)
# Original solution
from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
    a = cino()
    l = cina()
    ans = prod(l)
    # print(ans)
    if ans>1000000000000000000:
        print(-1)
    else:
        print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
    a = cino()
    l = cina()
    check = True
    suma = 1
    l.sort()
    if l[0]==0:
        print(0)
    else:
        for i in l:
            suma = suma*i
            if suma>1000000000000000000:
                check = False
                break
        if check:
            print(suma)
        else:
            print(-1)


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

# Optimized solution
n = int(eval(input()))
arr = list(map(int, input().split()))
ans = 1
f = 0
arr.sort()
for i in arr:
  ans *= i
  if ans > 1e18:
    f = 1
    print((-1))
    break
if f == 0:
  print(ans)
# Original solution
n=int(eval(input()))

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

ans = 1

for i in t:
  ans *= i

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

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

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

t.sort()

ans = 1

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

print(ans)
# Original solution
n = int(eval(input()))
a = [int(x) for x in input().split()]
 
p = 1
 
for e in a:
  if a == 0:
    print((0))
    exit()
  
  p *= e
  
if p > 10**18:
  print((-1))
else:
  print(p)

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

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

# Optimized solution
ans = 1
n = eval(input())
n = int(n)
nums = input().split()
for i in range(n):
    mul = int(nums[i])
    if mul == 0:
        print((0))
        exit()


for i in range(n):
    mul = int(nums[i])
    ans = ans * mul
    if ans > 10**18:
        print((-1))
        exit()

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

exit()
# Original solution
def main():
    n = int(eval(input()))
    a = list(map(int,input().split()))

    inf = 10**18
    res = a[0]
    for i in range(1,n):
        res *= a[i]
    if res > inf:
        print((-1))
        return 0
    else:
        print(res)

if __name__ == '__main__':
    main()



# Optimized solution
def main():
    n = int(eval(input()))
    a = sorted(list(map(int,input().split())),reverse=True)

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

    if res > inf:
        print((-1))
        return 0
    else:
        print(res)

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

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

for a in map(int, input().split()):
    ans *= a

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

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

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

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

# Optimized solution
n = eval(input())
nums = list(map(int, input().split(' ')))
nums.sort()
result = 1
for i in nums:
    result *= i
    if result > 10**18:
        result = -1
        break
    if result == 0:
        break
print(result)
# Original solution
eval(input())
ls = list(map(int, input().split(' ')))
result = 1
for i in ls:
    result *= i
if result > 10 ** 18:
    print((-1))
else:
    print(result)

# Optimized solution
eval(input())
ls = list(map(int, input().split(' ')))
ls.sort(reverse=True)

def main(ls):
    if ls.count(0) > 0:
        print((0))
        return
    result = 1
    for i in ls:
        result *= i
        if result > 10 ** 18:
            print((-1))
            return

    print(result)

main(ls)
# Original solution
eval(input())
ls = list(map(int, input().split(' ')))
ls.sort(reverse=True)

def main(ls):
    if ls.count(0) > 0:
        print((0))
        return
    result = 1
    for i in ls:
        result *= i
        if result > 10 ** 18:
            print((-1))
            return

    print(result)

main(ls)

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

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


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

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

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

# Optimized solution
import sys
input = sys.stdin.readline
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1 
if 0 in a:
    print((0))
    sys.exit(0)
for i in a:
    ans *= i
    if ans > 10**18:
        print((-1))
        sys.exit(0)
print(ans)
# Original solution
import functools
import operator

n = eval(input())
li = list(map(int, input().split()))
result = functools.reduce(operator.mul, li)

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

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

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

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

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

if A[0] == 0:
  print((0))
  quit()

result = 1

for a in A:
  result *= a
  if result > 1e18:
    print((-1))
    quit()

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

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

sum=1

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


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

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

sum=1

for i in a:
    sum*=i
    if sum > 10**18:
        if 0 in a:
            sum = 0
            break
        else:
            sum = -1
            break
print(sum)
# Original solution
from operator import mul
from functools import reduce
N=int(eval(input()))
li = list(map(int,input().split()))	
if reduce(mul, li)<=10**18:
  print((reduce(mul, li)))
else:
  print("-1")

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

result = As[0]
if 0 in As:
    print((0))
else:
    for i in range(n-1):
        result = result*As[i+1]
        if result > 10**18 :
            print((-1))
            break
        else:
            continue
    if result <= 10**18 :
        print(result)
# 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
for i in range(n):
    if a[i]==0:
        print((0))
        exit()
for i in range(n):
    if a[i]*ans>10**18:
        print((-1))
        exit()
    else:
        ans=ans*a[i]
print(ans)
# Original solution
# cook your dish here

num = int(eval(input()))
arr = list(map(int,input().split(" ")));

maxi = 1000000000000000000
val = 1;
for i in arr:
        val = val*i;

if val>maxi:
        print("-1")
else:
        print(val)
        

# Optimized solution
# cook your dish here

num = int(eval(input()))
arr = list(map(int,input().split(" ")));

maxi = 1000000000000000000

val = 1;
arr.sort()

if arr[0]==0:
        print((0))

else:
        for i in arr:
                val = val*i;
                if val>maxi:
                        val = -1
                        break
        
        
        print(val)
# Original solution
eval(input())
A = list(map(int, input().split()))
ans = 1
for a in A:
    ans *= a

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

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

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

for a in A:
    ans *= a
    if 1000000000000000000 < ans:
        print((-1))
        exit()

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

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

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

# Optimized solution
def main():
    N = int(eval(input()))
    A = list(map(int,input().split()))
    result = 1
    if 0 in A:
        print((0))
        return

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

main()
# Original solution
import sys

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

def solve():
    if 0 in l:
        return (0)
        sys.exit()

    x = 1
    for i in range(N):
        x = x * l[i]

    if x > (1000000000000000000):
        x = -1
        return str(x)
    else:
        return str(x)

print((solve()))

# Optimized solution
import sys

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

def solve():
    if 0 in l:
        return (0)
        sys.exit()

    x = 1
    for i in range(N):
        x = x * l[i]
        if x > (1000000000000000000):
            x = -1
            break

    return str(x)

print((solve()))
# Original solution
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list([int(x)-1 for x in input().split()])
def II(): return int(eval(input()))
def IF(): return float(eval(input()))
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    a = LI()
    ans = 1
    for ai in a:
        ans *= ai
    if ans > 10 ** 18:
        print((-1))
    else:
        print(ans)
    return


#main
if __name__ == '__main__':
    solve()


# Optimized solution
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list([int(x)-1 for x in input().split()])
def II(): return int(eval(input()))
def IF(): return float(eval(input()))
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    a = LI()
    a.sort()
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10 ** 18:
            print((-1))
            return
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()
# Original solution
import operator
from functools import reduce

N = int(eval(input()))
A = input().split()

length = len(A)

list = []

for num in range(length):
    list.append(int(A[num]))

result = reduce(operator.mul, list, 1)

max = 10**18

if result <= max:
    print(result)
else:
    print("-1")

# Optimized solution
n=int(eval(input()))
arr=list(map(int,input().split()))
arr=sorted(arr) #配列を昇順ソートしておく(配列に0がある場合0が先頭に来るので、場合分けの必要がなくなる)
ans=1
for val in arr:
 ans*=val #Pythonは多倍長整数をサポートしているので単に積を求めれば十分
 if ans>10**18:
   print((-1))
   break
else:
 print(ans)
# Original solution
n=int(eval(input()))
arr=list(map(int,input().split()))
arr=sorted(arr) #配列を昇順ソートしておく(配列に0がある場合0が先頭に来るので、場合分けの必要がなくなる)
ans=1
for val in arr:
 ans*=val #Pythonは多倍長整数をサポートしているので単に積を求めれば十分
 if ans>10**18:
   print((-1))
   break
else:
 print(ans)

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

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

# Optimized solution
n = int(eval(input()))
d = list(map(int, input().split()))
c_nega = 0
flag = False
for i in range(n):
  if d[i] == 0:
    flag = True
    break

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

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

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

answer = 1
if 0 in A:
    print((0))
else:
    for i in A:
        answer *= i
        if answer > 10**18:
            answer = -1
            break
    print(answer)
# Original solution
from functools import reduce
from operator import mul
N = int(eval(input()))
a = list(map(int,input().split()))

ans = reduce(mul, a)

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

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

if A.count(0) > 0:
  print((0))
else:
  ans = A[0]
  flag = 0
  for i in range(1,N):
    ans *= A[i]
    if ans > 10 ** 18:
      print((-1))
      flag += 1
      break
  if flag == 0:
    print(ans)
# Original solution
n = int(eval(input()))
li = [int(x) for x in input().split()]
ans = 1
for i in range(n):
    ans = ans * li[i]
if ans > 1000000000000000000:
    print("-1")
else:
    print(ans)


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

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

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

if ans<1000000000000000001:
    print(ans)
else:
    print((-1))


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

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


for i in range(len(A)):
    ans *= int(A[i])
if lim < ans and "0" not in A:
    print('-1')
else:
    print(ans)

# print(ans, lim)


# 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 > 1e18:
        break

if ans > 1e18:
    print((-1))
else:
    print(ans)
# Original solution
def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]
    
    out = 1
    for n in A:
        out = n * out
    
    if out > 1000000000000000000:
        print((-1))
    else:
        print(out)



main()

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

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

    if 0 in A:
        print((0))
    else:
        out = 1
        for n in A:
            out = n * out
            if out > 1000000000000000000:
                break
            else:
                continue
    
        if out > 1000000000000000000:
            print((-1))
        else:
            print(out)


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

# Optimized solution
N = int(eval(input()))
line = [int(i) for i in input().split()]
sum = 1
line.sort(reverse=True)
if line[len(line) -1]== 0:
  print((0))
  exit()
for num in line:
  sum = sum * num
  if sum > 10 ** 18:
    print((-1))
    exit()
print(sum)
# Original solution
n=int(eval(input()))
a=list(map(int, input().split()))
m=1

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

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



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

if 0 in a:
    print((0))
else:
    m=1
    for i in a:
        m*=i
        if 10**18 < m:
            print((-1))
            break
    else:
        print(m)
# Original solution
a = []
x = 1

n = int(eval(input()))
a = input().split()

for i in range(n):
    a[i-1] = int(a[i-1])
    x = x * a[i-1]
    
if x <= 10**18:
    print(x)
else:
    print((-1))

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

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

print(ans)
# Original solution
import sys

N = int(eval(input()))
As = [int(n) for n in input().split()]

limit = 10**18

prod = 1
over = False
for A in As:
    prod *= A
    if prod == 0:
        print((0))
        sys.exit(0)
    if prod > limit:
        over = True

if over:
    print((-1))
else:
    print(prod)

# Optimized solution
import sys

N = int(eval(input()))

As = [int(n) for n in input().split()]
As_set = set(As)

limit = 10**18

prod = 1

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

over = False
for A in As:
    prod *= A
    if prod > limit:
        print((-1))
        sys.exit(0)

print(prod)
# Original solution
N = eval(input())
A = list(map(int, input().split()))
ans = 1
for i in A:
    
    ans = ans * i
    if ans == 0:
        break

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

# Optimized solution
N = eval(input())
A = list(map(int, input().split()))
A.sort()
ans = 1
for i in A:

    ans = ans * i
    if ans == 0:
        break
    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 range(N):
    ans *= A[i]
if ans > 10**18:
    ans = -1
print(ans)

# Optimized solution
import sys
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
if 0 in A:
    print((0))
    sys.exit()
for a in A:
    ans *= a
    if ans > 10**18:
        print((-1))
        sys.exit()
print(ans)
# Original solution
from functools import reduce
n, *a = list(map(int, open(0).read().split()))
ans = reduce(lambda x, y: x*y, a, 1)
print((-1 if ans > 10**18 else ans))


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

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


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


# Optimized solution
def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    A.sort(reverse=True)

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

ans=main()
# Original solution
n = int(eval(input()))
lista = [int(e) for e in input().split()]
ans = 1
for i in lista:
    ans = ans *i

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

print(ans)

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

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

print(ans)