CodeEff/ECCO huggingface dataset:
# Original solution
N = int(eval(input()))
nums = list(map(int, input().split()))

cumul = 1
for i in range(N):
    cumul *= nums[i]

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


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

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

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

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

print(ans)

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

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

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

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
mu = 1
if 0 in a:
    print((0))
else:
    fl=0
    for i in range(n):
        mu = mu*a[i]
        if mu>10**18:
            print((-1))
            fl=1
            break
    # print(mu)
    if fl==0:
        print(mu)
# Original solution
#
# ~oisín~ Python3 Template
#

import sys
import math
import statistics
import datetime
import collections

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    ans = 1
    for x in a:
        ans *= x
    if ans > 1000000000000000000:
        print("-1")
    else:
        print(ans)

if __name__ == '__main__':
    main()


# Optimized solution
#
# ~oisín~ Python3 Template
#

import sys
import math
import statistics
import datetime
import collections

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    a.sort()
    ans = 1
    e = False
    for x in a:
        if ans > 1000000000000000000:
            print("-1")
            e = True
            break
        ans *= x
    if ans > 1000000000000000000 and e == False:
        print("-1")
    elif e == False:
        print(ans)

if __name__ == '__main__':
    main()
# Original solution
def resolve():
    '''
    code here
    '''
    N = int(eval(input()))
    A_list = [int(item) for item in input().split()]

    is_zero = False
    res = 1

    for item in A_list:
        res *= item

        if item == 0:
            is_zero = True
            break
    else:
        if res > 10 ** 18:
            print((-1))
        else:
            print(res)

    if is_zero:
        print((0))

if __name__ == "__main__":
    resolve()


# Optimized solution
def resolve():
    '''
    code here
    '''
    N = int(eval(input()))
    A_list = [int(item) for item in input().split()]

    is_zero = False
    is_over = False
    res = 1

    for item in A_list:
        if item == 0:
            is_zero = True
            break

    if is_zero:
        print((0))
    else:
        for item in A_list:
            res *= item

            if res > 10 ** 18:
                is_over = True
                break
        else:
            print(res)

        if is_over:
            print((-1))

if __name__ == "__main__":
    resolve()
# Original solution
import sys
from math import log10


def _i(): return int(sys.stdin.readline().strip())


def _ia(): return list(map(int, sys.stdin.readline().strip().split()))


def main():
    _ = _i()
    a = list(_ia())
    tmp = 0 if min(a) == 0 else sum(log10(ai) for ai in a)
    if tmp < 19:
        ret = 1
        for ai in a:
            ret *= ai
        if ret <= 10**18:
            return ret

    return -1


if __name__ == "__main__":
    print((main()))


# Optimized solution
import sys


def _i(): return int(sys.stdin.readline().strip())


def _ia(): return list(map(int, sys.stdin.readline().strip().split()))


def main():
    _ = _i()
    m = 10**18
    ret = 1
    for ai in sorted(_ia()):
        ret *= ai
        if ret > m:
            return -1
    return ret


if __name__ == "__main__":
    print((main()))
# Original solution
import math
n = int(eval(input()))
a = list(map(int, input().split()))
res = math.prod(a)
if res > 1e18:
    print((-1))
else:
    print(res)

# Optimized solution
def two(a):
    if 0 in a:
        return 0
    res = 1
    for el in a:
        res *= el
        if res > 1e18:
            return -1
    return res
n = int(eval(input()))
a = list(map(int, input().split()))
print((two(a)))
# Original solution
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))
else: print(s)



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

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

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

if 1e18 < res:
    print((-1))
else:
    print(res)


# Optimized solution
import sys

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

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

res = 1
for a in A:
    res *= a
    if 1e18 < res:
        print((-1))
        sys.exit()

print(res)
# Original solution
n=int(eval(input()))
arr=[int(i) for i in input().split()]
f=1 
prod=1 
for i in arr:
    prod*=i 
if prod>10**18:
        f=0 
print((prod if f else -1))

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

res = 1
for t in a:
    res *= t

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

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

res = 1
for t in a:
    res *= t
    if res > 10**18:
        print((-1))
        sys.exit()
    if res == 0:
        print(res)
        sys.exit()
else:
    print(res)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
result = 1
for number in a:
    result *= number
if result > 10 ** 18:
    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 number in a:
        result *= number
        if result > 10 ** 18:
            print((-1))
            return
    print(result)

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

# Optimized solution
n = int(eval(input()))
ans = 1
v = []
v = [int(x) for x in input().split()]
v.sort()
for x in v:
	ans = ans*x
	if ans > 1e18:
		break
if ans > 1e18:
	print((-1))
else :
	print(ans)
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
mul=1
for a in A:
    mul*=a
print((mul if mul<=10**18 else -1))

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
if 0 in A:
    print((0))
else:
    mul=1
    for a in A:
        mul*=a
        if mul>10**18:
            print((-1))
            exit()
    print(mul)
# Original solution
from functools import reduce
N = int(eval(input()))
As = list(map(int,input().split()))
f = True
r = reduce(lambda x, y: x * y, As)

if 1000000000000000001 <= r:
  print("-1")
else:
  print(r)



# Optimized solution
N = int(eval(input()))
As = list(map(int,input().split()))
c = int(As[0])
i = 0
f = True
if 0 in As:
  print("0")
else:
  for x in As:
    if i == 0:
      i += 1
      continue
    c = c * x 
    if 1000000000000000001 <= c:
      print("-1")
      f = False
      break
  if f:
    print(c)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
l=1
for i in range(n):
    l*=a[i]
if l>10**18:
    print((-1))
else:
    print(l)

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

for i in range(n):
    l*=a[i]
    if l>10**18:
        break
if min(a)==0:
    print((0))
elif l>10**18:
    print((-1))
else:
    print(l)
# Original solution
def mapint_inp():
    return list(map(int, input().split()))

def intinp():
    return int(eval(input()))

N = intinp()
A = list(mapint_inp())

lim = 10**18
ans = 1
f = True
for A_i in A:
    ans = ans*A_i
    if 0 in A:
        ans = 0
        break
    if ans > lim:
        f = False
        break

if f:
    print(ans)
else:
    print((-1))

# Optimized solution
def mapint_inp():
    return list(map(int, input().split()))

def intinp():
    return int(eval(input()))

N = intinp()
A = list(mapint_inp())

lim = 10**18
ans = 1
f = True
if 0 in A:
    ans = 0
else:
    for A_i in A:
        ans = ans*A_i
        if ans > lim:
            f = False
            break

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

# Optimized solution
n = int(eval(input()))
A = list(map(int,input().split()))
answer = 1
flag = 1
zero = 0
for i in range(n):
    answer *= A[i]
    if answer > pow(10,18):
        flag = 0
        break
if 0 in A:
    print((0))
elif flag ==0:
    print('-1')
else:
    print(answer)
# Original solution
#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))
  
n=int(eval(input()))
A=input_array()
MAX=10**18
ans=1

for i in A:
	ans*=i
if ans>MAX:
	print((-1))
else:
	print(ans)

# Optimized solution
#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def swap(a,b):
	tmp=a
	a=b
	b=tmp
	return a,b

n=int(eval(input()))
A=input_array()
MAX=10**18
A=sorted(A)
ans=A[0]
for i in range(1,len(A)):
	ans*=A[i]
	if ans==0:
		break
	elif ans>MAX:
		ans=-1
		break
	else:
		pass

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

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

l.sort(reverse = True)
ans = 1
for i in range(n):
    ans *= l[i]
    if ans > 10**18:
      ans = -1
      break
    if 0 in l:
      ans = 0
      break

print(ans)

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

l.sort(reverse = True)
ans = l[-1]
for i in range(n-1):
    ans *= l[i]
    if ans > 10**18:
      ans = -1
      break
    elif ans == 0:
      ans = 0
      break

print(ans)
# Original solution
def ABC_169_B():
    N=int(eval(input()))
    A = input().split()
    A = [int(s) for s in A]
    sum=1

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


if __name__ == '__main__':

    ABC_169_B()

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

reg = A[0]
flg=True
if 0 in A:
    print((0))
    flg=False
    reg=0
for i in range(1, N):
    reg *= A[i]
    if reg>10**18:
        print((-1))
        flg=False
        break
if flg:
    print(reg)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
for i in range(len(a)):
  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(len(a)):
  ans *= a[i]
  if ans > 10**18:
    print((-1))
    exit()
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = sorted(a)
ans = 1
for val in b:
  ans *= val
  if ans > 10**18:
    print((-1))
    exit()
print(ans)

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

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

res = 1
thr = 10**18
for a in A:
    res *= a

    if res > thr:
        res = -1

if 0 in A:
    res = 0

print(res)


# Optimized solution
# coding: utf-8

#import numpy as np

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

thr = 10**18

res = 1

if 0 in A:
    res = 0
else:
    for a in A:

        res *= a

        if res > thr:
            res = -1
            break

print((int(res)))
# Original solution
from operator import mul
from functools import reduce
N = int(eval(input()))
A = list(map(int, input().split()))

if 0 in A:
    print((0))
else:
    sum=reduce(mul,A)
    if sum>1000000000000000000:
        print((-1))
    else:
        print(sum)

# Optimized solution

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

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


# Optimized solution
n = int(eval(input()))
ls = list(map(int,input().split()))
ans = 1
if 0 in ls:
    print((0))
else:
    for i in range(n):
        ans *= ls[i]
        if ans > 10 ** 18:
            print((-1))
            break
    if ans <= 10 ** 18:
        print(ans)
# Original solution
n = int(eval(input()))
ans = 1
lst = list(map(int, input().split()))
for _ in lst:
    ans *= _

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

# Optimized solution
n = int(eval(input()))
ans = 1
lst = list(map(int, input().split()))
flg = 0
if 0 in lst:
    print((0))
else:
    for _ in lst:
        ans *= _
        if ans > 10**18:
            print((-1))
            flg = 1
            break
    if not flg :
        print(ans)
# Original solution
import sys

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

ans = 1

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

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

print(ans)
# Original solution
import math

# for _ in range(int(input())):
n = int(eval(input()))
a = list(map(int, input().split()))
p = 1
if 0 in a:
    print((0))
else:
    for i in range(len(a)):
        p = p * a[i]

    if p > math.pow(10, 18):
        print((-1))
    else:
        print(p)

# Optimized solution
import math

# for _ in range(int(input())):
n = int(eval(input()))
a = list(map(int, input().split()))
p = 1
r=0
m=math.pow(10,18)
if 0 in a:
    print((0))
else:
    for i in range(n):

        p = p * a[i]
        if p>m:
            r+=1
            break

    if r>0:
        print((-1))
    else:
        print(p)
# Original solution
from functools import reduce
from operator import mul

n = int(eval(input()))
numbers = tuple(map(int, input().split(' ')))

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


# Optimized solution
int(eval(input()))
numbers = tuple(map(int, input().split(' ')))

if 0 in numbers:
    print((0))
else:
    mul = 1
    for n in numbers:
        mul *= n
        if mul > 10 ** 18:
            print((-1))
            break
    else:
        print(mul)
# Original solution
import operator
from functools import reduce


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


# 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
for i in a:
    ans *= i
    if 1000000000000000000 < ans:
        ans = -1
        break
    elif 0 in a:
        ans = 0
        break
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 a:
        ans *= i
        if 1000000000000000000 < ans:
            ans = -1
            break
    print (ans)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))

num = 1

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

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

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

a_sum = 1

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

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

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

res=1
for x in A:
	res*=x

if res>pow(10,18):
	print('-1')
else:
	print(res)

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

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

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

res=1
for x in A:
	res*=x
	if res>pow(10,18):
		print('-1')
		exit()

else:
	print(res)
# Original solution
N=int(eval(input()))

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

result=1
for i in X:
  result*=i
  if result>10**18:
    result=-1
  
for i in X:
  if i==0:result=0

print(result)


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

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

result=1
for i in X:
  result*=i
  if result>10**18:
    result=-1
    break
for i in X:
  if i==0:result=0

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

ans = 1

for i in A_list:
    ans = ans * i


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

print(ans)

# Optimized solution
n, *A = list(map(int, open(0).read().split()))

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

ans = 1
for a in A:
    ans *= a
    if ans > 10 ** 18:
        exit(print(-1))
print(ans)
# Original solution
import sys
input = lambda: sys.stdin.readline().rstrip()

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

a.sort()

if a[0] == 0:
    print((0))
else:
    m = 1
    i = 0
    while m < 10**18:
        m *= a[i]
        if m > 10**18:
            print((-1))
            sys.exit()
        i += 1
        if i == n:
            print(m)
            sys.exit()

# Optimized solution
import sys
input = lambda: sys.stdin.readline().rstrip()

n = int(eval(input()))
a = [int(x) for x in input().split()]
a.sort()
if a[0] == 0:
    print((0))
    sys.exit()
b = 1
for i in a:
    b *= i
    if b > 10**18:
        print((-1))
        sys.exit()
print(b)
# Original solution
# B

N = int(eval(input()))
AN = list(map(int, input().split()))
ans = 1
for A in AN:
    ans *= A

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

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

for i in a:
    ans *= i

if ans > 10**18:
    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()))

a0 = a[0]
a_else = a[1:]

for ai  in a_else:
    a0 *= ai


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

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

a0 = a[0]
a_else = a[1:]
th = 10**18
for ai in sorted(a_else):
    a0 *= ai
    if a0 > th:
        print('-1')
        exit()

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

if ans < 0:
    ans = -1
print(ans)

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

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

INF=1000000000000000000

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

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


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

INF=1000000000000000000
if 0 in A:
    print((0))
else:
    ans=1
    for n in range(N):
        ans*=A[n]
        if ans>INF:
            break

    if ans>INF:
        print((-1))
    else:
        print(ans)
# Original solution
import functools
import operator

# ĺĽĺ
n = int(eval(input()))
a_list = list(map(int, input().split()))

ans = functools.reduce(operator.mul, a_list)

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


# Optimized solution
import functools
import operator

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

if 0 in a_list:
    ans = 0
else:
    k = len(a_list) - a_list.count(1)
    # print(k)
    if k > 60:
        ans = -1
    else:
        ans = functools.reduce(operator.mul, a_list)
        if ans > 10 ** 18:
            ans = -1
        else:
            pass
print(ans)
# Original solution
def main():
    n = int(eval(input()))
    a=1
    l=[int(x) for x in input().split()]
    for i in range(len(l)):
        a=a*l[i]
        
    if a>10**18:
        a=-1
    print(a)
main()

# Optimized solution
def main():
    n = int(eval(input()))
    a=1
    l=[int(x) for x in input().split()]
    if not(0 in l):
        for i in range(len(l)):
            a=a*l[i]
            if a>10**18:
                a=-1
                break
    else:
        a=0
    print(a)
main()
# Original solution
import functools
import operator
N =int(eval(input()))

B = 1

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

result = functools.reduce(operator.mul,A)

#print(B)
C = 10 ** 18
#print(C)
if result > C:
    print((-1))
else:
    print(result)


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

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

B = 1
C = 10 ** 18

for i in range(N):
    B = B * A[i]
    if B == 0:
        break
    elif B > C:
        B = -1
        break

print(B)
# 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(ans)
else:
    print((-1)) 

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

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:
        for j in range(i+1,n):
            if A[j] == 0:
                print((0))
                exit()
        print((-1))
        exit()
print(ans)