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

p = 10 ** 18

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

if ans > p:
    ans = -1

print(ans)

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

p = 10 ** 18

ans = 1

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

print(ans)
# Original solution
N = int(eval(input()))
ans = 1
for a in [int(hoge) for hoge in input().split()]:
    ans *= a
if ans > 10**18:
    print((-1))
else:
    print(ans)


# Optimized solution
N = int(eval(input()))
A = [int(hoge) for hoge in input().split()]
if 0 in A:
    print((0))
else:
    ans = 1
    for a in A:
        ans *= a
        if ans>10**18:
            ans = -1
            break
    print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
result = 1
for _a in a:
    result *= _a
if result > 10**18:
    print("-1")
else:
    print(result)

# Optimized solution
int(eval(input()))
a = sorted(list(map(int, input().split())))
result = 1
if a[0] == 0:
    print("0")
    exit()
for _a in a:
    result *= _a
    if result > 10**18:
        print("-1")
        exit()
print(result)
# Original solution
eval(input())
int_list = list(map(int, input().split()))
max_num = 10**18
ans = 1
for i in int_list:
    ans *= i
if ans <= max_num:
    print(ans)
else:
    print((-1))

# Optimized solution
eval(input())
int_list = list(map(int, input().split()))
max_num = 10**18
ans = 1
for i in int_list:
    ans *= i
    if ans > max_num:
        if min(int_list) == 0:
            print((0))
        else:
            print((-1))
        break
else:
    print(ans)
# Original solution
n = int(eval(input()))
lst = list(map(int,input().split()))
res = 1
for i in lst:
    res *= i
if res > 1000000000000000000:
    print((-1))
else:
    print(res)


# Optimized solution
def cal():
    n = int(eval(input()))
    lst = list(map(int,input().split()))
    if 0 in lst:
    	return 0
    else:
        prod = 1
        for a in lst:
            prod *= a
            if prod > 1000000000000000000:
                return -1
    return prod
print((cal()))
# Original solution
n=int(eval(input()))
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print((0))
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        exit
    else:
        continue
    
  if ans<1000000000000000001:
      print(ans)
  else:
      print((-1))


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

if 0 in li:
  print((0))
  exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>10**18:
        print((-1))
        exit()
    else:
        continue
    
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
result = 1
checker =False
for j in a:
  if j > 1000000000000000000:
    result = -1
    checker =True
if 0 in a:
  result = 0
  checker=True
while checker==False:
  i = 0
  while i != len(a):
    result = result*a[i]
    i += 1
  checker = True
    

if result <= 1000000000000000000:
  print(result)
else:
  print((-1))


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
result = 1
for i in range(len(a)):
  result = result*a[i]
  if result == 0:
    break
  elif result > 1000000000000000000:
    break

if result <= 1000000000000000000:
  print(result)
else:
  print((-1))
# Original solution
def main():
    N=int(eval(input()))
    A=[int(x) for x in input().split()]
    ans=1
    for a in A:
        ans*=a
    if ans > 10**18:
        print((-1))
    else:
        print(ans)
    return

if __name__=='__main__':
    main()


# Optimized solution
def main():
    N=int(eval(input()))
    A=[int(x) for x in input().split()]
    A.sort()
    ans=1
    for a in A:
        ans*=a
        if ans > 10**18:
            break
        elif ans == 0:
            break
    if ans > 10**18:
        print((-1))
    else:
        print(ans)
    return

if __name__=='__main__':
    main()
# Original solution
n = int(eval(input()))
A = input().split()

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

# Optimized solution
n = int(eval(input()))
A = input().split()
A.sort()

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

print(s)
# Original solution
import functools
import operator
n = int(eval(input()))
a = [int(i) for i in input().split()]

N = functools.partial(functools.reduce, operator.mul)
ans = N(a)
if ans > 10**18:
    print((-1))
else:
    print(ans)

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

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

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

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

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

    print(SUM)
main()
# Original solution
import functools
import operator

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

ans = functools.reduce(operator.mul, 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 i in range(N):
  ans = ans * a[i]
  if (ans > 10 ** 18):
    break
  
if (ans > 10**18):
  if a.count(0) > 0:
    print((0))
  else:
    print((-1))
else:
  print(ans)
# Original solution
n = int(eval(input()))
arr = input().split()
def mult():
    if 0 in arr:
        print((0))
        return 0
    a = 1
    for i in arr:
        a = a * int(i)
    if a > 1000000000000000000:
        print((-1))
        return 0
    else: 
        print(a)
        return 0

mult()


# Optimized solution
n = int(eval(input()))
arr = input().split()


def mult():
    if "0" in arr:
        return 0
    else:
        a = 1
        for i in arr:
            a = a * int(i)
            if a > 1000000000000000000:
                return -1
        return a

print((mult()))
# Original solution
a=int(eval(input()))
b=list(map(int,input().split()))
x=1;
if 0 in b:
  print((0))
else:
	for i in b:
  		x=x*i
	if x>10**18:
  		print((-1))
	else:
  		print(x)

# Optimized solution
a=int(eval(input()))
b=list(map(int,input().split()))
x=1;
if 0 in b:
  print((0))
  exit()
for i in b:
  x=x*i
  if x>10**18:
  	print((-1))
  	exit()
print(x)
# Original solution
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    p = 1
    m = pow(10, 18)
    for n in A:
        p = p * n
    if p > m:
        return -1
    return p


# 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]"
    print((solve(N, A)))

if __name__ == '__main__':
    main()


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


def solve(N: int, A: "List[int]"):
    p = 1
    m = pow(10, 18)
    if 0 in A: return 0
    for n in A:
        p = p * n
        if p > m:
            return -1
    return p


# 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]"
    print((solve(N, A)))

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


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

arg = list(map(int, input().split()))
ans = 1

if 0 in arg:
    ans = 0
else:
    for m in arg:
        ans *= m

        if ans > 1000000000000000000:
            ans = -1

print(ans)


# Optimized solution
#!/usr/bin/env python3
n = int(eval(input()))

arg = list(map(int, input().split()))
ans = 1

if 0 in arg:
    ans = 0
else:
    for m in arg:
        ans *= m

        if ans > 1000000000000000000:
            ans = -1
            break

print(ans)
# Original solution
N = int(eval(input()))
A = [int(e) for e in 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 = [int(e) for e in 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))
            break
    else:
        print(ans)
# Original solution
n = int(eval(input()))

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

ans = 1;
for num in num_list:
    ans = ans * num

if ans > 1000000000000000000:
    ans = -1

print(ans)


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

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

ans = 1;
for num in num_list:
    ans *= num
    if ans > 1000000000000000000:
        ans = -1
        break

if 0 in num_list:
    ans = 0

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

a = [0] * n

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

sum = 1

for i in a:
    sum *= i

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


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

a = [0] * n

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

sum = 1
cnt = 0
if 0 in a:
    print((0))
else:
    for i in a:
        sum *= i
        if sum > 1000000000000000000:
            print((-1))
            cnt = 1
            break
    if cnt == 0:
        print(sum)
# Original solution
def main():
    import sys
    n = int(eval(input()))
    a = list(map(int, input().split()))

    ans = 1
    for i in a:
        if i == 0:
            print((0))
            sys.exit()
        ans *= i

    if ans > 10 ** 18:
        print((-1))
        sys.exit()

    print(ans)

if __name__ == '__main__':
    main()


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

    try:
        if a.index(0):
            print((0))
            sys.exit()
    except ValueError:
        pass

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

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
A = list(map(int, input().rstrip().rsplit()))
A_dict = {}

for val in A:
    A_dict[val] = A_dict.get(val, 0) + 1

limit = 10**18
ans = 1
for val in A_dict:
    ans *= val ** A_dict[val]

if ans > limit:
    ans = -1

print(ans)


# Optimized solution
N = int(eval(input()))
A = list(map(int, input().rstrip().rsplit()))
A_dict = {}

for val in A:
    A_dict[val] = A_dict.get(val, 0) + 1

limit = 10**18
ans = 1

if A_dict.get(0, 0) > 0:
    ans = 0
else:
    for val in A_dict:
        ans *= val ** A_dict[val]

        if ans > limit:
            ans = -1
            break

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

r = 1
for tt in t:
    r *= tt

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

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

    r = 1
    if 0 in t:
        print((0))
        return

    for tt in t:
        r *= tt
        if r > 10**18:
            print((-1))
            return

    print(r)

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

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

A = sorted(A, reverse=True)
#print(A)

if A[-1] == 0:
  print((0))
  exit()
  
ans = 1

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

print(ans)
# Original solution
n = int(eval(input()))
x = input().split()
a = 0
b = 1
while a <= n - 1 :
  b = b * int(x[a])
  a += 1
if b <= 1000000000000000000:
  print(b)
else:
  print((-1))

# Optimized solution
n = int(eval(input()))
x = input().split()
a = 0
b = 1
if x.count('0') >= 1:
  print((0))
else:
  while a <= n - 1 and b <= 1000000000000000000:
    b = b * int(x[a])
    a += 1
  if b > 1000000000000000000:
    print((-1))
  else:
    print(b)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
s = 1
for i in range(N):
    s = s * A[i]
    i += 1
if s > 10**18:
    print((-1))
else:
    print(s)

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

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

d=1

for b in a:
  
  d=d*b
if d>10**18:
  print("-1")
else:
  print(d) 

# Optimized solution
def main():

	n=eval(input())
	a=list(map(int,input().split()))
	
	
	if 0 in a:
		print((0))
		return

	d=1
    
	

	for b in a:
		d=d*b
		if d>10**18:
			print("-1")
			return
	print(d)

main()
# Original solution
N = int(eval(input()))

b = 1

a = list(map(int, input().split()))
for i, a in enumerate(a):
    try:
        b *= a
    except:
        print("-1")
if b > pow(10, 18):
    print("-1")
else:
    print(b)
        


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

b = 1

a = sorted(list(map(int, input().split())), reverse=True)
if a[-1] == 0:
    print("0")
    sys.exit()
for i in a:
    b *= i
    if b > pow(10, 18):
        print("-1")
        sys.exit()
print(b)
# Original solution
import sys
N = int(eval(input()))

b = 1

a = sorted(list(map(int, input().split())), reverse=True)
if a[-1] == 0:
    print("0")
    sys.exit()
for i in a:
    b *= i
    if b > pow(10, 18):
        print("-1")
        sys.exit()
print(b)

        


# Optimized solution
import sys
N = int(eval(input()))
a = list(map(str, input().split()))
total = 1

if '0' in a:
    print('0')
    sys.exit()
for i in a:
    total *= int(i)
    if total > 10**18:
        print('-1')
        sys.exit()
print(total)
# Original solution
if __name__ == '__main__':
    a = int(eval(input()))
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    for i in b:
        if  0 in b:
            ans = 0
            break
        ans *= i
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)


# Optimized solution
if __name__ == '__main__':
    a = int(eval(input()))
    b = [int(i) for i in input().split()]
    ans = 1
    b.sort(reverse=True)
    if 0 in b:
        ans = 0
    else:
        for i in range(len(b)):
            ans *= b[i]
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)
# Original solution
# coding:utf-8
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
# coding:utf-8

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

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

for i, a in enumerate(A):
    if i == 0:
        ans = a
    else:
        ans *= a
        if ans > 10 ** 18:
            print((-1))
            exit(0)
print(ans)
# Original solution
n = int(eval(input()))

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

ans = 1

for x in l:
  ans = ans*x
  
if(ans > 1000000000000000000):
  print((-1))
else:
  print(ans)

# Optimized solution
def main():
    n = int(eval(input()))
    l = list(map(int, input().split()))
    ans = 1
    
    if 0 in l:
      print((0))
      return
 
    for x in l:
        ans = ans*x
        if(ans > 1000000000000000000):
            print((-1))
            return
    print(ans)
 
main()
# Original solution
from math import sqrt,gcd,ceil 
def ii():return int(eval(input()))
def mi():return list(map(int,input().split()))
def li():return list(mi())
def si():return eval(input())

n=ii()
a=li()
s=1
for i in a:
    s*=i
if(s>1e18):
    s=-1
print(s)

# Optimized solution
from math import sqrt,gcd,ceil 
def ii():return int(eval(input()))
def mi():return list(map(int,input().split()))
def li():return list(mi())
def si():return eval(input())

n=ii()
a=li()
s=1
if 0 in a:
    print((0))
    exit(0)
for i in a:
    s*=i
    if(s>1e18):
        break
if(s>1e18):
    s=-1
print(s)
# Original solution
n = int(eval(input()))
a = 1
for i in map(int, input().split()):
  a *= i

print((-1 if a > 10**18 else a))


# Optimized solution
n = int(eval(input()))
ans = 1
a = sorted(map(int, input().split()))
for i in a:
  ans *= i
  if ans > 10**18:
    print((-1))
    break
else:
  print(ans)
# Original 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 ()

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
count = 1
 
if 0 in a:
  print((0))
  exit()
  
for A in a:
  count *= A
  if count > 1000000000000000000:
    print((-1))
    exit()
print(count)
# 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
if A.count(0) >= 1:
    print((0))
    exit()

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

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

if 0 in A:
    t = 0
else:
    for i in A:
        t *= i

if t > a:
    print("-1")
else:
    print(t)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
t = 1
a = 10 ** 18

if 0 in A:
    t = 0
else:
    for i in A:
        t *= i
        if t > a:
            break

if t > a:
    print("-1")
else:
    print(t)
# Original solution
n= int(eval(input()))
a_list = list(map(int, input().split()))
 
ans=1
for i in range(n):
  ans=ans*a_list[i]
  if ans==0:
    break
  
if ans>1000000000000000000:
  ans=-1
  
print(ans)

# Optimized solution
n= int(eval(input()))
a_list = list(map(int, input().split()))
 
a_list = [n for n in a_list if n!=1]  
#print(a_list)
ans=1

if 0 in a_list:
  ans=0
elif len(a_list)>56:
  ans=-1
else:
  for i in a_list:
    ans=ans*i
  if ans>1000000000000000000:
      ans=-1
  
print(ans)
# Original solution
import sys
input = sys.stdin.readline

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

m = 1
j = 0

if 0 in AS:
    print((0))
    j = 1

for i in AS:
    m = m * i
    if m > 10**18 and j == 0:
        print((-1))
        j = 1
        break
    elif m == 0:
        break
    else:
        continue

if j == 0:
    print(m)

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

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

m = 1
j = 0

if 0 in AS:
    print((0))
    j = 1
    

if j == 0:
    for i in AS:
        m = m * i
        if m > 10**18 and j == 0:
            print((-1))
            j = 1
            break
        elif m == 0:
            break
        else:
            continue

if j == 0:
    print(m)
# 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()))

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

    ans = 1
    i = 0
    while (i <= n - 1):
        if ans <= 10 ** 18:
            ans *= a[i]
            i += 1
        else:
            break

    #print(i)
    if ans <= 10 ** 18:
        print(ans)
    else:
        print((-1))
# Original solution

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

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




# Optimized solution

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

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

for a in A:
    ans = ans*a

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

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

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

while count <= N - 1:
    ans *= S[count]
    count += 1

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

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

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

res = 1
for i in range(n):
  res = res * nums[i]
  if res <= 10**18 or 0 in nums:
    continue
  else:
    res = -1
    break
    
print(res)


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

res = 1

if 0 in nums:
  print((0))
  exit()
  
for i in range(n):
  res = res * nums[i]
  if res <= 10**18 :
    continue
  else:
    res = -1
    break
print(res)