CodeEff/ECCO huggingface dataset:
# Original solution
# https://atcoder.jp/contests/abc169/submissions/13893064

def main():
    from itertools import zip_longest

    LIMIT = 10 ** 18

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

    while len(A) > 1:
        A = [x * y for x, y in zip_longest(A[::2], A[1::2], fillvalue=1)]

    if A[0] > LIMIT:
        print((-1))
    else:
        print((A[0]))


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

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


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()))

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

ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        print((-1))
        exit()
    
print(ans)
# Original solution
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(eval(input()))

def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def SI(): return input().split()

def printlist(lst, k='\n'): print((k.join(list(map(str, lst)))))
INF = float('inf')

from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product
from heapq import heapify, heappop, heappush


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


if __name__ == '__main__':
    solve()


# Optimized solution
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(eval(input()))

def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def SI(): return input().split()

def printlist(lst, k='\n'): print((k.join(list(map(str, lst)))))
INF = float('inf')

from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product
from heapq import heapify, heappop, heappush


def solve():
    n = II()
    A = LI()
    th = 1_000_000_000_000_000_000
    ans = 1
    if 0 in A:
        print((0))
        return

    for a in A:
        ans *= a
        # print(a, ans)
        if ans > th:
            print((-1))
            return
    print(ans)


if __name__ == '__main__':
    solve()
# Original solution
import operator
from functools import reduce
n = eval(input())
l = [int(each) for each in input().split()]
result = reduce(operator.mul,l)
if result > 10**18:
    result = -1
print(result)

# Optimized solution
n = eval(input())
l = [int(each) for each in input().split()]
if 0 in l:
    print((0))
else:
    result = 1
    for each in l:
        result *= each
        if result > 1000000000000000000:
            result = -1
            break
    print(result)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
if 0 in A:
    print((0))
else:
    for a in A:
        ans *= 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:
    print((0))
else:
    for a in A:
        ans *= a
        if ans > 10 ** 18:
            ans = -1
            break
    print(ans)
# Original solution
from operator import mul
from functools import reduce

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

result = reduce(mul, a)
if result <= 10 ** 18:
    print(result)
else:
    print((-1))


# Optimized solution
import sys

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

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

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

print(ans)
# Original solution
from operator import mul
from functools import reduce

n=int(eval(input()))
a=list(map(int,input().split()))
limit=10**18

ans = 1
ans = reduce(mul, a) #=> 1320

# for i in range(n):
#   ans *= a[i]
#   if a[i] == 0:
#     break
#   elif (ans*a[i]) > limit:
#     ans = -1
#     break

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


# Optimized solution
# from operator import mul
# from functools import reduce

n=int(eval(input()))
a=list(map(int, input().split()))
# limit=10**18

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

ans = 1
# ans = reduce(mul, a) #=> 1320

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

for i in range(n):
  if a[i] == 0:
      ans = 0

# if ans > limit:
#   print(-1)
# else:
print(ans)
# Original solution
N = int(eval(input()))
L = list(map(int,input().split()))
ans = 1
for i in range(N):
    ans = ans*L[i]
if ans <= 10**18 and i == N-1:
    print(ans)
elif ans >= 10**18 and i == N-1:
    print("-1")


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

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

for i in L:
    ans = ans*i
    if ans > 10**18:
        print((-1))
        sys.exit()
print(ans)
# Original solution
N = int(eval(input()))
A = [int(i) for i in input().split()]
res=1
for x in A:
    res = res*x
if res > 10**18:
    print((-1))
else:
    print(res)

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

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

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

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

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

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

print(ans)
# Original solution
N=int(eval(input()))
A=[*list(map(int,input().split()))]
a=1
while A:
  a*=A.pop()
if a > 10**18:
  print((-1))
else:
  print(a)

# Optimized solution
N=int(eval(input()))
A=[*list(map(int,input().split()))]
a=1
if 0 in A:
  a=0
else:
  while A:
    a*=A.pop()
    if a>10**18:
      a=-1
      break
print(a)
# Original solution
import sys
def main():
    N = int(eval(input()))
    A_list = [int(_) for _ in input().split()]
    ans = 1
    for i in range(N):
        ans *= A_list[i]

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

# Optimized solution
import sys
def main():
    N = int(eval(input()))
    A_list = [int(_) for _ in input().split()]
    ans = 1
    
    if 0 in A_list:
        out = 0
        print(out)
        sys.exit()
    
    for i in range(N):
        ans = ans * A_list[i]
        
        if ans>1000000000000000000:
            ans = -1
            break
    out = ans
    print(out)

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


# Optimized solution
def main():
    n = int(eval(input()))
    a = [int(s) for s in input().split()]
    ans = 1
    if 0 in a:
        print((0))
        return
    for i in a:
        ans *= i
        if ans > (10 ** 18):
            ans = -1
            break
    print(ans)
main()
# Original solution

def main():
    n = int(eval(input()))
    array = list(map(int, input().split()))
    ans = 1
    for i in range(n):
        ans *= array[i]
        re = 10 ** 18

    
    if ans > re:
        print((-1))
    else:
        print(ans)
    return 0
        
main()

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

res = 1
for i in a:
  if i == 0:
    print((0))
    break
  else:
    res *= i

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

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

res = 1
for i in a:
  if i == 0:
    print((0))
    break
  if res > 10**18: continue
  else: res *= i

else:
  print((-1 if res > 10**18 else res))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

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

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

if 0 in A:
  print((0))
  exit()
else:
  flag = True
  prd = 1
  A.sort(reverse=True)
  for i in range(N):
    prd *= A[i]
    if prd > 10**18:
      flag = False
      break
if flag:
  print(prd)
else:
  print((-1))
# Original solution
num = eval(input())
a = input().split()

b=1
if '0' in a:
	b = 0
else:
	for i in a:
		b *= int(i)

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

print(b)

# Optimized solution
num = eval(input())
a = input().split()

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

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

if 0 in S:
    print((0))
elif 10 ** 18 in S:
    print((-1))
else:
    ans = 1
    for s in S:
        ans *= s
    if ans > 10 ** 18:
        print((-1))
    else:
        print(ans)

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

def f():
    if 0 in S:
        return 0
    elif 10 ** 18 in S:
        return -1
    else:
        ans = 1
        for s in S:
            ans *= s
            if ans > 10 ** 18:
                return -1
        return ans

print((f()))
# Original solution
import sys

from operator import mul
from functools import reduce


def main():
  input = sys.stdin.readline
  N = int(eval(input()))
  a= tuple(map(int , input().split()))
  ans=reduce(mul, a)
  if ans > 10**18:
    print((-1))
  else:
    print(ans)

if __name__ == '__main__':
    main()

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

print(ans)
# Original solution
import math
import bisect
#[int(x) for x in input().split()]
#map(int,input().split())
#for _ in range(int(input())):
n=int(eval(input()))
l=[int(x) for x in input().split()]
p=1
M=10**18
f=0
for i in range(n):
	p*=l[i]

if p>M:
	print((-1))
	f=1
	
if f==0:
	print(p)



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

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

	if x[i]!=1 and x[i]!=0:
		ans=ans*x[i]
	if ans>10**18:
		break
	if x[i]==0:
		ans=0
		break
if ans>10**18:
	print((-1))
else:
	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()))

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

ans = 1
for i in range(N):
    ans *= A[i]
    if ans > 10 ** 18:
        print((-1))
        exit()
print(ans)
# Original solution
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    ans = 1
    threshold = 1000000000000000000
    for x in A:
        ans *= x
    if (ans > threshold):
        print((-1))
    else:
        print(ans)


# 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()


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


def solve(N: int, A: "List[int]"):
    ans = 1
    threshold = 1000000000000000000
    if 0 in A:
        print((0))
        exit()

    for x in A:
        ans *= x
        if (ans > threshold):
            print((-1))
            exit()
    print(ans)


# 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
n = int(eval(input()))
str_list = input().split()

result = 1

for i in range(n):
  result = result * int(str_list[i])
  
t = 1
for j in range(18):
  t = t * 10

if(result > t):
  print('-1')
else:
  print(result)
   


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

list = [int(k) for k in str_list]

list.sort(reverse=True)

result = 1

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

for i in range(n):
  result = result * list[i]
  if(result > 1000000000000000000):
    print('-1')
    exit()

print(result)
# Original solution
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline
def inpS(): return inp().rstrip().decode()
readlines = sys.stdin.buffer.readlines 
MOD = 10**9+7
INF = 1<<60

from operator import mul
from functools import reduce
def resolve():
    N = int(inp())
    A = list(map(int, inp().split()))
    limit = 10**18
 
    _prod = reduce(mul, A)
    if _prod <= limit:
        print(_prod)
    else:
        print((-1))
        
if __name__ == "__main__":
    resolve()

# Optimized solution

def resolve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    limit = 10**18

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

    _mul = 1
    for a in A:
        _mul *= a
        if _mul > limit:
            print((-1))
            return

    print(_mul)

if __name__ == "__main__":
    resolve()
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

x = 1
if 0 in a:
    print((0))
else:
    for i in range(n):
        x *= a[i]
    
    if x > 1000000000000000000:
        print((-1))
    else:
        print(x)


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

x = 1
flag = False
INF = 10**18
if 0 in a:
    print((0))
else:
    for i in range(n):
        if flag == False:
            x *= a[i]
        if x > INF:
            flag = True
    
    if flag:
        print((-1))
    else:
        print(x)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
m = 1
for i in range(n):
  m = m*a[i]
if m<= 10**18:
  print(m)
else:
  print((-1))

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

n = int(eval(input()))
a = list(map(int, input().split()))
s = functools.reduce(operator.mul, a)
if(s > 1e18):
    print((-1))
else:
    print(s)

# Optimized solution
import math

n = int(eval(input()))
s = 1
frag = 0
a = list(map(int, input().split()))
if(0 in a):
    print((0))
else:
    for i in range(len(a)):
        s *= a[i]
        if(s > 10**18):
            frag = 1
            break
    if(frag):
        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

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

# 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:
    if ans > 10**18:
        ans = -1
        break
    ans*=i

print((ans if ans <= 10**18 else -1))
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=1
cnt=0
while cnt<n:
  if a[cnt]==0:
    print((0))
    exit()
  ans*=a[cnt]
  cnt+=1
if ans>10**18:
  print((-1))
  exit()
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:
    print((-1))
    exit()
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1

check = True
zero = False

for i in a:
    ans = ans*i

    if i==0:
        zero = True

    if ans>1000000000000000000:
        check = False




if zero:
    print((0))
else:
    if check:
        print(ans)
    else:
        print((-1))

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

check = True
zero = False

for i in range(0,n):
    if a[i]==0:
        zero = True
        break;




for i in range(0,n):
    ans = ans*a[i]

    if ans>1000000000000000000:
        check = False
        break;




if zero:
    print((0))
else:
    if check:
        print(ans)
    else:
        print((-1))
# Original solution
import sys
input = sys.stdin.readline

"""

"""

tot = 1
n = int(eval(input()))
arr = list(map(int, input().split()))

for v in arr:
    tot *= v

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


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

"""

"""

tot = 1
n = int(eval(input()))
arr = list(map(int, input().split()))

for v in arr:
    if v == 0:
        tot = 0
        break
    if tot <= 10**18:
        tot *= v
    

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

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

res = 1
overflow = False

for a in A:
  res *= a
  if res > 10**18:
    overflow = True

if overflow == True and res != 0:
  print((-1))
else:
  print(res)
    

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

A = tuple(map(int, input().split()))

res = 1
overflow = False

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

i = 0
while i < len(A) and res <= 10**18:
  res *= A[i]
  i += 1


if res > 10 ** 18:
  print((-1))
else:
  print(res)
# Original solution
import sys
sys.setrecursionlimit(10**8)
def line_to_int(): return int(sys.stdin.readline())
def line_to_each_int(): return list(map(int, sys.stdin.readline().split()))
def line_to_list(): return list(map(int, sys.stdin.readline().split()))
def line_to_list_in_iteration(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
# def dp(init, i, j): return [[init]*i for i2 in range(j)]
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
# from itertools import accumulate #A = [0]+list(accumulate(A))
# import bisect #bisect.bisect_left(B, a), bisect.bisect_right(B,a)

n = line_to_int()
a = line_to_list()

from functools import reduce, partial
from operator import mul

prod = partial(reduce, mul)

if 0 in a:
    print((0))
else:
    if prod(a) <= 10**18:
        print((prod(a)))
    else:
        print((-1))
# ans = a[0]
# if 0 in a:
#     print(0)
# else:
#     for i in range(1,n):
#         ans = ans * a[i]
#     if ans <= 10**18:
#         print(ans)
#     else:
#         print(-1)

# Optimized solution
import sys
sys.setrecursionlimit(10**8)
def line_to_int(): return int(sys.stdin.readline())
def line_to_each_int(): return list(map(int, sys.stdin.readline().split()))
def line_to_list(): return list(map(int, sys.stdin.readline().split()))
def line_to_list_in_iteration(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
# def dp(init, i, j): return [[init]*i for i2 in range(j)]
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
# from itertools import accumulate #A = [0]+list(accumulate(A))
# import bisect #bisect.bisect_left(B, a), bisect.bisect_right(B,a)

n = line_to_int()
a = line_to_list()

# from functools import reduce, partial
# from operator import mul

# prod = partial(reduce, mul)

# if 0 in a:
#     print(0)
# else:
#     if prod(a) <= 10**18:
#         print(prod(a))
#     else:
#         print(-1)
ans = a[0]
limit = 10**18
if 0 in a:
    print((0))
else:
    for i in range(1,n):
        if ans <= limit:
            ans = ans * a[i]
        else:
            print((-1))
            exit()
    if ans <= limit:
        print(ans)
    else:
        print((-1))
# Original solution
#!/usr/bin/env python3


N = int(eval(input()))
A = [int(s) for s in input().split()]

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

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




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

import sys

N = int(eval(input()))
A = [int(s) for s in input().split()]

for a in A:
    if a == 0:
        print((0))
        sys.exit(0)

ans = 1
for a in A:
    if (ans > 10**18):
        print((-1))
        sys.exit(0)
    ans *= a

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

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


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

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

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

    print(anser)

main()
# Original solution
n = int(eval(input()))
num_list = list()
string = input().split()
for i in range(n):
	num_list.append(int(string[i]))
pro = 1
for number in num_list:
	pro *= number
if pro > 10**18:
	pro = -1
print(pro)

# Optimized solution
n = int(eval(input()))
num_list = list()
string = input().split()
for i in range(n):
	num_list.append(int(string[i]))
del n
del string
num_list = sorted(num_list)
pro = 1
for number in num_list:
	pro *= number
	if pro > 10**18:
		pro = -1
		break
print(pro)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

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