CodeEff/ECCO huggingface dataset:
# Original solution
n=int(eval(input()))
A=list(map(int,input().split()))
use=1 
for i in range(n):
    use*=A[i]

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

# Optimized solution
n=int(eval(input()))
A=list(map(int,input().split()))
want=A.count(0)
if want:
    print((0))
    exit()
use=1 
for i in range(n):
    use*=A[i]
    if use>10**18:
        print((-1))
        exit()

print(use)
# Original solution
from functools import reduce

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

res = reduce(lambda a, b: a*b, A)
if res > 10 ** 18:
    print((-1))
else:
    print(res)


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

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

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


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


    if flg == 1:
        print((-1))
    else:
        print(ans)
# Original solution
n = int(eval(input()))
A = [int(i) for i in input().split()]
work = 1
for a in A:
    work *= a
if work > 10**18:
    print('-1')
else:
    print(work)

# Optimized solution
n = int(eval(input()))
A = [int(i) for i in input().split()]
check = [i for i in A if i == 0]
if 0 in check:
    print((0))
else:   
    A.sort(reverse=True)
    work = 1
    for a in A:
        work *= a
        if work > 10**18:
            print('-1')
            break
    else:
        print(work)
# Original solution
n=int(eval(input("")))
k=1
li=list(map(int,input("").split(" ")))
if 0 in li:
    print("0")
else:
    for i in li:
        k*=int(i)
    if k>1000000000000000000:
        print("-1")
    else:
        print(k)


# Optimized solution
n=int(eval(input("")))
k=1
li=list(map(int,input("").split(" ")))
if 0 in li:
    print("0")
else:
    for i in li:
        k*=int(i)
        if k>1000000000000000000:
            print("-1")
            break
    else:
        print(k)
# Original solution
n=int(eval(input()))
arr=list(map(int,input().split()))
ans=1
def solve(arr,ans):
    for i in arr:
        ans*=i
    if(ans>10**18):
        return(-1)
    return(ans)
print((solve(arr,ans)))


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

    maks = 10**18
    mnozenje = 1
    for i in a:
        mnozenje *= int(i)

    if mnozenje > maks:
        print((-1))
    else:
        print(mnozenje)


if __name__ == '__main__':
    main()


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

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

    maks = 10**18
    mnozenje = 1
    for i in a:
        mnozenje *= i

        if mnozenje > maks:
            print((-1))
            return

    print(mnozenje)


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

# Optimized solution
n = int(eval(input()))
lis = list(map(int, input().split()))
a = 1
for i in range(n):
    a = a * lis[i]
    if a > 1000000000000000000:
        a = -1
        if 0 in lis:
            a = 0
        break
print(a)
# Original solution
from operator import mul
from functools import reduce
N = int(input().strip())
A = list(map(int,input().split()))
x = reduce(mul, A)
if x > 1000000000000000000:
    print("-1")
else:
    print(x)


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

ans=1

for i in range(N):
    ans=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()))

A.sort()
A.reverse()

if A[N-1]==0:
    print((0))
    sys.exit()
ans=1
for i in range(N):
    ans=ans*A[i]
    if ans>10**18:
        print((-1))
        sys.exit()
print(ans)
# Original solution
# -*- coding: utf-8 -*-

def main():

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

    ans = 1

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

    print(ans)


if __name__ == "__main__":
    main()

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

def main():

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

    ans = 1

    if 0 not in A:
        for i in A:
            ans *= i
            if ans > 10 ** 18:
                ans = -1
                break

    else:
        ans = 0

    print(ans)


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

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

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

print(ans)

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

ans = 1

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

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


print(ans)
# Original solution
a=int(eval(input()))
List = list(map(int, input().split()))
res =1
for i in range(a):
  res = res *List[i]
if res > 1000000000000000000:
  res = -1
print(res)

# Optimized solution
a=int(eval(input()))
List = list(map(int, input().split()))
res =1
List.sort()
for i in range(a):
  res = res *List[i]
  if res > 1000000000000000000:
    res = -1
    break
  elif res == 0:
    break
  else:
    pass
print(res)
# Original solution
def Judge(x,y):
    sum=1
    for i in range(y):
        sum*=x[i]
        #print(sum)
    if sum>10**18:
        return -1
    else:
        return sum

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

c=Judge(a,n)
print(c)

# Optimized solution
def Judge(x,y):
    sum=1
    for i in range(y):
        if x[i]==0:
            return 0
    for i in range(y):
        sum*=x[i]
        #print(sum)
        if sum>10**18:
            return -1
    return sum

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

c=Judge(a,n)
print(c)
# 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 0 in a:
    ans = 0
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
ans = A[0]

for n in range(1,N):
  ans = ans * A[n]

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 = A[0]

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


print(ans)
# Original solution
eval(input())
a = list(map(int, input().split()))
ans = 1
from functools import reduce
from operator import mul
ans = reduce(mul, a)
if(ans > 10 ** 18):
    ans = -1
print(ans)

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

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

n = ii()
a = li()
ans = 1
for i in range(len(a)):
    ans *= a[i]

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

# Optimized solution
ii = lambda : int(eval(input()))
mi = lambda : list(map(int,input().split()))
li = lambda : list(map(int,input().split()))

bb = 10**18

def main():
    n = ii()
    a = li()
    ans = 1

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

    for i in range(len(a)):
        ans *= a[i]
        if ans > bb:
            print((-1))
            break
    else:
        print(ans)

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

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
from operator import mul
from functools import reduce

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

cnt = 1
if 0 in a:
    print((0))
    exit()

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

ans = 1
INF = 1000000000000000000

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


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

ans = 1
INF = 1000000000000000000

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

for a in A:
    ans *= a
    if ans > INF:
        print((-1))
        exit()

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

# Optimized solution
n = eval(input())
l = list(map(int, input().split()))
ans = 1
for i in l:
    if i == 0:
        ans = 0
if (ans != 0):
    for i in l:
        if (ans * i) <= 1e18:
            ans = ans * i
        else:
            ans = -1
            break
print(ans)
# Original solution
import functools
import operator
prod = functools.partial(functools.reduce, operator.mul)
N=int(eval(input()))
risuto=list(map(int,input().split()))
ans=prod(risuto)

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

# Optimized solution
import math
N=int(eval(input()))
risuto=list(map(int,input().split()))
ans=1
kari=0
if 0 in risuto:
    print((0))
else:
    for j in range(N):
        kari+=math.log10(risuto[j])

    if kari<18:
        for i in range(N):
            ans*=risuto[i]
        print(ans) 
    elif kari==18:
        for i in range(N):
            ans*=risuto[i]
        if ans>10**18:
            print((-1))
        else:
            print(ans)
    else:
        print((-1))
# Original solution
n=int(eval(input()))
l=list(map(int,input().split()))
mod=1000000000000000000
ans=1
p=1
l.sort()
for i in range(0,n):
  x=l[i]
  p=p*x
  if(x==0):
    ans=0
    break
if(p>mod):
    ans=-1
if(ans!=0 and ans!=-1):
  ans=p
print(ans)
  
  


# Optimized solution
n=int(eval(input()))
l=list(map(int,input().split()))
mod=1000000000000000000
ans=1
p=1
if(l.count(0)>=1):
    ans=0
else:
    for i in range(0,n):
        x=l[i]
        p=p*x
        if(p>mod):
            ans=-1
            break
if(ans!=0 and ans!=-1):
    ans=p
print(ans)
# Original solution
import functools
import operator

N = int(eval(input()))
v = ((list(map(int, input().split()))))
answer = functools.reduce(operator.mul,v)
answer = answer if answer <= 1000000000000000000 else -1
print(answer)

# Optimized solution
N = int(eval(input()))
v = list(map(int, input().split()))
limit = 10 ** 18

answer = 1
if 0 in v:
  answer = 0
else:
  for i in v:
    answer = answer * i
    if answer <= limit:
      continue
    else:
      answer = -1
      break
print(answer)
# Original solution
n = int(eval(input()))
upper = 1e18
res = 1
for x in map(int, input().split()):
   res *= x
print((-1 if res > upper else res))

# Optimized solution
n = int(eval(input()))
upper = 1e18
res = 1
generator = list(map(int, input().split()))
for x in generator:
   res *= x
   if res > upper:
      break

for x in generator:
   if x == 0:
      res = 0
   
print((-1 if res > upper else res))
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))

sum=1
for _ in A:
    sum*=_

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


# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
sum=1
for _ in A:
    sum*=_
    if sum>10**18:
        break
if 0 in A:
    print("0")
elif sum>10**18:
    print("-1")
else:
    print(sum)
# Original solution
a = int(eval(input()))
ar = list(map(int,input().split(" ")))
if 0 in ar:
    print((0))
    exit()
b = 1
for r in ar:
    b *= r
    if b > 10 ** 18:
        print((-1))
        exit()
print(b)


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


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

nums = list(map(int,input().split(" ")))
s = 1
for num in nums:
    s = s * num
if s > 10**18:
    print((-1))
else:
    print(s)
    


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

nums = list(map(int,input().split(" ")))
s = 1
limit = 10**18
flag = False
for num in nums:
    s = s * num
    if s > limit:
        flag = True
        break

if flag:
    if 0 not in nums:
        print((-1))
    else:
        print((0))
else:
    print(s)
# Original solution
import functools
n = int(eval(input()))
li_a = list(map(int, input().split()))

if 0 in li_a:
    print((0))
    exit(0)
w = functools.reduce(lambda x, y: x * y, li_a)
if w > 10 ** 18:
    print((-1))
    exit(0)
else:
    print(w)
    exit(0)


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

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

# Optimized solution
n = int(eval(input()))
A = [*list(map(int,input().split()))]
A.sort()
ans = 1
for a in A:
    ans *= a
    if ans > 10**18:
        ans = -1
        break
print(ans)
# Original solution
from functools import reduce
def main():
    from operator import mul
    from functools import reduce
    n, *a = list(map(int, open(0).read().split()))
    b = reduce(mul, a)
    if b > 10 ** 18:
        print((-1))
    else:
        print(b)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    n, *a = list(map(int, open(0).read().split()))
    ans = 1
    if a.count(0):
        print((0))
        exit()
    for i in a:
        ans *= i
        if ans > 10 ** 18:
            print((-1))
            break
    else:
        print(ans)


if __name__ == '__main__':
    main()
# Original solution
from functools import reduce
from operator import mul
n = int(eval(input()))
A = list(map(int, input().split()))
ans = reduce(mul, A)
print((ans if ans <= 10**18 else -1))

# Optimized solution
n = int(eval(input()))
A = list(map(int, input().split()))
if 0 in A:
    print((0))
else:
    bound = 10 ** 18
    ans = 1
    for a in A:
        ans = ans * a
        if ans > bound:
            ans = -1
            break
    print(ans)
# Original solution
import sys
N = int(eval(input()))
A = list(map(int,input().split()))
AA=1
a = pow(10,18)
for i in range(N):
  AA = AA * A[i]
  if AA == 0:
    print((0))
    sys.exit()
print((AA if AA <= a else -1))

# Optimized solution
import sys
N = int(eval(input()))
A = list(map(int,input().split()))
A.sort()
mul = A[0]
for i in range(1,N):
  mul *= A[i]
  if mul > 10**18:
    print((-1))
    sys.exit()
print(mul)
# Original solution
def LI():return list(map(int,input().split()))
def yes():return print("Yes")
def no():return print("No")
from collections import deque, defaultdict, Counter
from heapq import heappop, heappush
# import math
# pi=math.pi
# print(pi)
# yes()
# no()
n=int(input())

# s=input()
a=LI()
ans=1
for q in a:
    ans*=q
if ans>10**18:
    ans=-1
print(ans)



# Optimized solution
def LI():return list(map(int,input().split()))
def yes():return print("Yes")
def no():return print("No")
from collections import deque, defaultdict, Counter
from heapq import heappop, heappush
# import math
# pi=math.pi
# print(pi)
# yes()
# no()
n=int(input())

# s=input()
a=LI()
a.sort()
if a[0]==0:
    print(0)
    exit()

ans=1
for q in a:
    ans*=q
    if ans>10**18:
        print(-1)
        exit()
print(ans)
# Original solution
n,*a=list(map(int,open(0).read().split()))
MX=10**18
prod=1
for q in sorted(a):
  prod*=q
  if prod>MX:
    print((-1))
    exit()
print(prod)


# Optimized solution
n,*a=map(int,open(0).read().split())
a.sort()
if a[0]==0:
  exit(print(0))
ans=1
for q in a:
  ans*=q
  if ans>10**18:
    print(-1)
    exit()
print(ans)
# Original solution
n = int(eval(input()))
aaa = list(map(int, input().split()))
ans = 1
for a in aaa:
    ans *= a
print((int(ans) if ans <= 10 ** 18 else -1))

# Optimized solution
import sys
read = sys.stdin.readline
n = int(eval(input()))
aaa = list(map(int, read().split()))
aaa.sort()
ans = 1
for a in aaa:
    ans *= a
    if ans == 0:
        break
    if ans > 10 ** 18:
        ans = -1
        break
print((int(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
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,*a=list(map(int,open(0).read().split()))
ans=1
for i in range(n):
  ans*=a[i]
if ans>10**18:
  ans=-1
print(ans)

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


# Optimized solution
n=eval(input())
a=[int(i) for i in input().split()]
t=10**18
r=1
if 0 in a:
    print((0))
else:
    for i in a:
        r*=i
        if t < r:
            print((-1))
            break
    else:
        print(r)
# Original solution
#!/usr/bin/env python3
n = int(eval(input()))
a = list(map(int, input().split()))
m = 1
for i in a:
    m = m * i
if m >10**18:
    print((-1))
else:
    print(m)

# Optimized solution
#!/usr/bin/env python3
n = int(eval(input()))
a = list(map(int, input().split()))
m = 1
for i in a:
    m = m * i
    if m > 1000000000000000000:
        m = -1
        break
if 0 in a:
    print((0))
else:
    print(m)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
ans =1;
iszero = False

if 0 in A:
  iszero = True

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

print(ans)


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

if 0 in A:
  iszero = True
for i in range(N):
  if(iszero):
    ans = 0
    break
  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 range(n):
    ans*=a[i]
if ans>10**18:
    print((-1))
else:
    print(ans)

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

# Optimized solution
num=int(eval(input()))
i = list(map(int, input().split()))
if 0 in i:
    print((0))
else:
    ans=1
    for n in range(num):
        ans=ans*i[n]
        if ans > 10**18:
            ans=-1
            break
    print(ans)
# Original solution
def func(n, a):
	tmp = [0 for i in range(n)]
	tmp[0] = a[0]
	if(0 in a):
		return 0
	for i in range(1, n):
		tmp[i] = tmp[i-1] * a[i]
		
	if(tmp[i] > 10**18):
			return '-1'
	
	return str(tmp[-1])

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

# Optimized solution
def func(n, a):
	if(0 in a):
		return 0
	tmp = [0 for i in range(n)]
	tmp[0] = a[0]
	for i in range(1, n):
		tmp[i] = tmp[i-1] * a[i]
		if(tmp[i] > 10**18):
			return '-1'
	
	return str(tmp[-1])

n = int(eval(input()))
a = list(map(int, input().split()))
s = func(n, a)
print(s)
# 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
# coding: utf-8
# Your code here!

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

main()
# Original solution
#!/usr/bin/env python3
import sys
from itertools import chain

MAX = 10 ** 18


def solve(N: int, A: "List[int]"):
    A = sorted(A)
    answer = 1
    for a in A:
        answer *= a
        if a > 0:
            if answer > MAX:
                return -1
    return answer


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    # N, A = map(int, line.split())
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    answer = solve(N, A)
    print(answer)


if __name__ == "__main__":
    main()


# Optimized solution
#!/usr/bin/env python3
import sys
from itertools import chain

MAX = 10 ** 18


def solve(N: int, A: "List[int]"):
    A = sorted(A)
    answer = 1
    for a in A:
        answer *= a
        if answer > MAX:
            return -1
    return answer


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    # N, A = map(int, line.split())
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    answer = solve(N, A)
    print(answer)


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

flag = True
ans = 1
if 0 in A:
    print((0))
    flag = False

if flag:
    for i in A:
        ans *= i
        if ans > pow(10,18):
            print((-1))
            flag = False
            break

if flag:
    print(ans)