CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))
l = [int(item) for item in input().split()]
l.sort()
product = 1
flag=0
for i in l:
	product *= i
	if product > int(10**18):
		print("-1")
		flag=1
		break
 
if flag == 0:
	print(product)

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


def solve(N: int, A: "List[int]"):
    if(0 in A):
        print((0))
        sys.exit()

    sum_l = 1
    for x in A:
        sum_l *= x
        if(sum_l > 10 **18):
            print((-1))
            sys.exit()

    print(sum_l)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()
# Original solution
a = 10**18
N = int(eval(input()))
A = list(map(int , input().split()))
ans = 1
for i in A:
    if 0 in A:
        ans = 0
        break
    ans *= i
    if ans > a:
        ans = -1
        break
print(ans)

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

# Optimized solution
n = int(eval(input()))
A = list(map(int,input().split()))
A.sort()
ans = A[0]
INF = 1000000000000000000
for i in range(1,n):
    l,r = len(str(ans)),len(str(A[i]))
    if l+r > 21:
        ans = -1
        break
    else:
        ans = ans * A[i]
        if ans > INF:
            ans = -1
            break
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

sq=A[0]
for i in range(1,N):
    sq *= A[i]

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

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


if 0 in A:
    print((0))
else:
    sq=A[0]
    for i in range(1,N):
        sq *= A[i]

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

    print(sq)
# Original solution
# B - Multiplication 2

import sys
readline = sys.stdin.readline

N = int(readline())
A = list(int(x) for x in readline().split())

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

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

# Optimized solution
# B - Multiplication 2

import sys
readline = sys.stdin.readline

N = int(readline())
A = list(int(x) for x in readline().split())
A.sort()

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

if ans > 10**18:
    print((-1))
else:
    print(ans)
# Original solution
N = int(eval(input()))

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

total = a[0]

for i in range(1,N):
    total *= a[i]
    if  10 ** 18 < total and 0 not in a:
        print((-1))
        exit()
print(total)


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

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

a.sort()

if a[0] == 0:
    print((0))
    exit()

total = a[0]

for i in range(1,N):
    total *= a[i]
    if  10 ** 18 < total:
        print((-1))
        exit()
print(total)
# Original solution
limit = 1000000000000000000

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

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

if result < 0 or result > limit:
  result = -1

print(result)

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

limit = 1000000000000000000

result = 1
if 0 not in A:
  for i in A:
    result = result * i
    if result > limit:
      result = -1
      break
else:
  result = 0

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

from functools import reduce as r
from operator import mul

ans=r(mul,a)

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

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

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

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

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

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
D=int(1)
ans=int(0)
A.sort()
if A[0]==0:
    ans==0
else:
    A.sort(reverse=True)
    for i in range(N):
        D*=A[i]
        if  D>10**18:
            ans=-1
            break

        else:
            ans=D
        

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

a = list(int(i) for i in input().split(" "))

prod = 1

for i in a:
  prod *= i

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

print(prod)

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

a = list(int(i) for i in input().split(" "))

prod = 1

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


print(prod)
# Original solution
import math
import re
import copy
import sys

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

# Optimized solution
import math
import re
import copy
import sys

n = int(eval(input()))
a = list(map(int,input().split()))
ceil = 10 ** 18
ans = 1
if all([b > 0 for b in a]):
    for i in range(n):
        ans *= a[i]
        if ans > ceil:
            break
if any([b == 0 for b in a]):
    print((0))
elif ans > ceil:
    print("-1")
else:
    print(ans)
# Original solution
ini = lambda : int(eval(input()))
inm = lambda : list(map(int,input().split()))
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y

n = ini()
a = inl()
ans = 1
lim = 10 ** 18
for i in a:
        ans *= i
if ans > lim:
        ans = -1
print(ans)


# Optimized solution
ini = lambda : int(eval(input()))
inm = lambda : list(map(int,input().split()))
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y

n = ini()
a = inl()
ans = 1
lim = 10 ** 18
for i in a:
        ans *= i
        if ans > lim:
                ans = -1
                break
if min(a) == 0:
        ans = 0
print(ans)
# Original solution
x=int(eval(input()))
input = list(map(int, input().split()))

multi=1
for i in range(len(input)):
  multi *= input[i]
  
if(multi > (10 ** 18)):
  print((-1))
else:
  print(multi)

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

for i in range(len(input)):
  if(input[i]==0):
    print((0))
    exit(0)

multi=1
for i in range(len(input)):    
  multi *= input[i]
  if(multi > (10 ** 18)):
    print((-1))
    exit(0)

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

A.sort()
if A[0] == 0:
  print((0))
else:
  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()))

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

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

# Optimized solution
N = int(eval(input()))
lst = list(map(int,input().split()))
if 0 in lst:
  s = 0
else:
  s = 1
  for x in lst:
    s = s*x
    if s > 10**18:
      s = -1
      break
print(s)
# Original solution
import sys
N = int(eval(input()))
A_list = list(map(int ,input().split()))

s = 1


for i in range(len(A_list)):
        s = s*A_list[i]
        if A_list[i] == 0:
            print("0")
            sys.exit()
if s>pow(10,18):
        print("-1")
else:
        print(s)

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

s = 1

A_list.sort()
if A_list[0]==0:
    print("0")
    sys.exit()
for i in range(len(A_list)):
        s = s*A_list[i]
        if s>pow(10,18):
            print("-1")
            sys.exit()

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

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

# Optimized solution
import math
n=int(eval(input()))
a=[int(x) for x in input().split()]
a_log=[]
if 0 not in a:
  for i in a:
    i_log=math.log10(i)
    a_log.append(i_log)
  
  if sum(a_log)>18:
    print("-1")
  else:
    for i in range(n-1):
  	  a[i+1]*=a[i]
    if a[n-1]>10**18:
      print("-1")
    else:
      print((a[n-1]))
else:
  print("0")
# Original solution
from functools import reduce
import operator

eval(input())
ans = reduce(operator.mul, list(map(int, input().split())), 1)
ans = ans if ans <= 10 ** 18 else -1
print(ans)

# Optimized solution
from functools import reduce
import operator

def f():
    eval(input())
    s = input().split()

    if "0" in s:
        return 0

    ans = 1
    for num in map(int,s):
        ans *= num
        if ans > 10 ** 18:
            return -1
    return ans

print((f()))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
for i in A:
    ans *= i
if ans > pow(10, 18):
    print((-1))
else:
    print(ans)

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

ans = 1
for i in A:
    ans *= i
    if ans > pow(10, 18):
        ans = -1
        break
print(ans)
# Original solution
# coding=utf-8

if __name__ == '__main__':
    N = int(eval(input()))
    li_A = list(map(int, input().split()))

    ans = li_A[0]

    for i in range(1,N):
        if (ans * li_A[i]) <= 1000000000000000000:
            ans = ans * li_A[i]

        else:
            ans = -1

    print(ans)

# Optimized solution
# coding=utf-8
import sys

if __name__ == '__main__':
    N = int(eval(input()))
    li_A = list(map(int, input().split()))

    ans = li_A[0]

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

    for i in range(1, N):
        if ans * li_A[i] > 1000000000000000000:
            print('-1')
            sys.exit()
        else:
            ans *= li_A[i]

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

if 0 in list:
    ans=0
else:
    ans=1
    for i in range(n):
        ans=ans*list[i]

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

print(ans)

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

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

print(ans)
# Original solution
N = int(eval(input()))
AA = list(map(int,input().split()))
res = AA[0]
for a in AA[1:]:
    res = res*a
if res>1e18:
  print('-1')
else:         
  print(res)

# Optimized solution
N = int(eval(input()))
AA = list(map(int,input().split()))
res = AA[0]
if 0 in AA:
  print((0))
else:
  for a in AA[1:]:
    res = res*a
    if res>1e18:
      print('-1')
      exit()
  print(res)
# Original solution
_ = eval(input())
l = list(map(int,input().split()))
ans = 1
for i in l:
    ans *= i
if ans > 10**18:
    print((-1))
else:
    print(ans)

# Optimized solution
_ = eval(input())
l = list(map(int,input().split()))
flag = True
if 0 in l:
    print((0))
else:
    ans = 1
    for i in l:
        ans *= i
        if ans > 10**18:
            print((-1))
            flag = False
            break
    if(flag):
        print(ans)
# Original solution
n = int(eval(input()))
A = list(map(int, input().split()))
s =  1
f=0

for a in A:
    s = s*a

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

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

if 0 in A:
    print((0))
else:
    for a in A:
        s = s*a
        if s > 10**18:
            f=1
            break
    if f==1:
        print((-1))
    else:
        print(s)
# Original solution
def main():
    _ = eval(input())
    a = sorted(list(map(int, input().split())), reverse=True)
    if a[-1] == 0:
        print((0))
        return
    x = 1
    m = 10 ** 18
    for i in a:
        if i > m:
            print((-1))
            return
        if i < 2:
            continue
        x *= i
    print((-1 if x > 10 ** 18 else x))


if __name__ == '__main__':
    main()

# Optimized solution
def main():
    _ = eval(input())
    a = sorted(list(map(int, input().split())), reverse=True)
    if a[-1] == 0:
        print((0))
        return
    x = 1
    m = 10 ** 18
    for i in a:
        if i < 2:
            continue
        x *= i
        if x > m:
            print((-1))
            return
    print((-1 if x > 10 ** 18 else x))


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 > 10**18:
    print((-1))
else:
    print(ans)

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

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

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

s = 1
for x in a:
  s *= x
if s > 1000000000000000000:
  print((-1))
else:
  print(s)


# Optimized solution
import sys

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

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

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

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

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

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

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

print(ans)

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

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

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

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

ans = 1
flg = True

if 0 in A: print((0))
else:
    for i in range(N):
        ans *= A[i]
        if ans > 1e18:
            flg = False
            break

    if flg: print(ans)
    else:print((-1))
# Original solution
n = int(eval(input()))
ans = 1
arr = [int(x) for x in input().split()]
for each in arr:
    ans *= each
if (ans > 1e18):
    print((-1))
else:
    print(ans)


# Optimized solution
n = int(eval(input()))
ans = 1
arr = [int(x) for x in input().split()]
arr.sort()
for each in arr:
    ans *= each
    if (ans > 1e18):
        print((-1))
        exit(0)
print(ans)
# Original solution
n = int(eval(input()))
cnt = 1
l = list(map(int, input().split()))
for i in l:
    cnt *= i
if cnt > 10** 18:
    print((-1))
else:
    print(cnt)

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

n = int(eval(input()))
nums = list(map(int, input().split()))
res = 1
for i in range(n):
    res *= nums[i]
if res <= 1000000000000000000:
    print(res)
else:
    print((-1))

# Optimized solution
n = int(eval(input()))
nums = list(map(int, input().split()))
res = 1
for i in range(n):
    if( nums[i] == 0):
        res = 0
if(res != 0):
    for i in range(n):
        res *= nums[i]
        if(res > 1000000000000000000):
            break
if res <= 1000000000000000000:
    print(res)
else:
    print((-1))
# Original solution
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    A = list(map(int, args[1].split()))

    ret = 1
    for a in A:
        if 10**18 < ret*a:
            ret = -1
        else:
            ret *= a

    return str(ret)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))


# Optimized solution
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    A = list(map(int, args[1].split()))
    A.sort()

    ret = 1
    for a in A:
        if 10**18 < ret*a:
            ret = -1
            break
        else:
            ret *= a

    return str(ret)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))
# Original solution
N=int(eval(input()))
#A=[int(x) for x in input().strip().split(" ")]
A=list(map(int,input().split()))
x=1
c=1000000000000000000
for i in range(N):
    if x<c or x!=0:
        x *=A[i]
if x>c:
    print("-1")
else:
    print(x)

# Optimized solution
def main():
    N=int(eval(input()))
    A=list(map(int,input().split()))
    if 0 in A:
        print((0))
        return
    
    prod=1
    for a in A:
        prod *=a
        if prod > 1000000000000000000:
            print((-1))
            return
    
    print(prod)
main()
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

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

if ans > max_limit:
  print((str(-1)))
else:
  print((str(ans)))

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
ans = 1
max_limit = 10 ** 18
for i in range(N):
  ans *= A[i]
  if ans > max_limit:
    ans = -1
    break

if ans > max_limit:
  print((str(-1)))
else:
  print((str(ans)))
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
s = 1
x = 0
y = 0
for i in range(n):
    s *= a[i]
    if a[i] == 0:
        y += 1
    if s > 1000000000000000000:
        x += 1

if y != 0:
    print((0))
else:
    if x != 0:
        print((-1))
    else:
        print(s)


# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
s = 1
x = 0
y = 0
for i in range(n):
    s *= a[i]
    if a[i] == 0:
        y += 1
    if s > 1000000000000000000:
        s = 0
        x += 1

if y != 0:
    print((0))
else:
    if x != 0:
        print((-1))
    else:
        print(s)
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
ans=1
flag=0
for i in range(N):
  ans*=A[i]
  if ans>10**18:
    flag=1
  
if ans==0:
  flag=0
if flag==0:
  print(ans)
else:
  print("-1")

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

for i in range(N):
    ans = ans * A[i]
'''
for i in range(N):
    if ans > 10**18+1:
        break
    else:
        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 ans > 10**18+1:
        break
    else:
        ans = ans * A[i]

if 0 in A:
    print((0))
elif ans > 10**18:
    print((-1))
else:
    print(ans)
# Original solution
num = int(eval(input()))
nums = list(map(int,input().split()))
ans = 1
for j in nums:
    ans = ans * j
if(ans > pow(10,18)):
    print('-1')
else:
    print(ans)


# Optimized solution
n = int(eval(input()))
a = [int(_) for _ in input().split()]
a.sort()
ans = 1
for i in a:
    if i == 0:
        ans = 0
        break
    ans *= i
    if ans > 10**18:
        ans = -1
        break
 
print(ans)
# Original solution
# coding:utf-8
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
# coding:utf-8
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:
        print((-1))
        exit()

print(ans)
# Original solution
n=int(eval(input()))
tmp = 1
dat = list(map(int, input().split(" ")))
for d in dat:
    tmp *= d

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

# Optimized solution
n=int(eval(input()))
tmp = 1
dat = list(map(int, input().split(" ")))
#print(dat, (0 in dat))
over = False
if 0 in dat:
    print ("0")
else:
    for d in dat:
        tmp *= d
        if tmp > 1000000000000000000:
            print ("-1")
            over = True
            break
    if not over:
        print (tmp)
# 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()))
ans=1
if 0 in a:
    ans=0
else:
    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()))

if 0 in A:
    print((0))

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

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


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

if 0 in A:
    print((0))

else:
    total = 1
    for i in range(N):
        total *= A[i]
        if total > 10**18:
            total = -1
            break
    print(total)
# Original solution
from functools import reduce

N = int(eval(input()))
A = list(map(int, input().split()))
ans = reduce(lambda x0, x1: x0 * x1, A)
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:
    ans = 0
else:
    for a in A:
        ans *= a
        if ans > 10 ** 18:
            ans = -1
            break

print(ans)