CodeEff/ECCO huggingface dataset:
# Original solution
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return list(map(int,input().split()))
def onem(): #Nとかの取得
	return int(eval(input()))
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(list(map(max,x)))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

n = onem()

a = l()

ans = a[0]

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

print(ans)



# Optimized solution
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return list(map(int,input().split()))
def onem(): #Nとかの取得
	return int(eval(input()))
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(list(map(max,x)))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

n = onem()

a = l()

ans = a[0]

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

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:
    ans = -1
print(ans)


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

def main():
    N = int(eval(input()))
    A = [int(c) for c in input().split(' ')]
    A.sort(reverse=True)

    if A[-1] == 0:
        print('0')
        exit()
    elif A[0] > 1e18:
        print('-1')
        exit()

    ret = 1
    for x in A:
        ret = ret * x
        # if ret > 1e18:
        #     print('-1')
        #     exit()
        # elif ret == 0:
        #     print('0')
        #     exit()

    if ret == 0:
        print('0')
        exit()
    elif ret > 1e18:
        print('-1')
        exit()
    print(f'{ret}')


if __name__ == "__main__":
    main()

# Optimized solution
#import functools

def main():
    N = int(eval(input()))
    A = [int(c) for c in input().split(' ')]
    A.sort(reverse=True)

    if A[-1] == 0:
        print('0')
        exit()
    elif A[0] > 1e18:
        print('-1')
        exit()

    ret = 1
    for x in A:
        ret = ret * x
        if ret > 1e18:
            print('-1')
            exit()
        elif ret == 0:
            print('0')
            exit()

    if ret == 0:
        print('0')
        exit()
    elif ret > 1e18:
        print('-1')
        exit()
    print(f'{ret}')


if __name__ == "__main__":
    main()
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1
a = sorted(a,reverse=True)
for i in a:
	ans *=i
	if(0 in a):
		print((0))
		exit()
	if(ans>1000000000000000000):
		print((-1))
		exit()
print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1
a = sorted(a,reverse=True)
if(0 in a):
	print((0))
	exit()
for i in a:
	if(len(str(i)) + len(str(ans)) > 20):
		print((-1))
		exit()
	ans *=i

print((ans if(ans<=pow(10,18)) else -1))
# Original solution
def solve(n, a):
  if 0 in a:
    return 0
  else:
    p = 1
    x = 10**18
    for i in a:
      p*=i
    if p>x:
      p = -1
    return p

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

# Optimized solution
def solve(n, a):
  if 0 in a:
    return 0
  else:
    p = 1
    x = 10**18
    for i in a:
      if p<=x:
      	p*=i
      else:
        break
    if p>x:
      p = -1
    return p

n = int(eval(input()))
a = [int(x) for x in input().split()]
print((solve(n, a)))
# Original solution
import sys
input = sys.stdin.readline
n = int(eval(input()))
n_list = list(map(int, input().split()))

#n = int(input())
#n_list = list(map(int, input().split()))

multi = 1

for i in range(n):
    multi *= n_list[i]

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

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

multi = 1
a = 1

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

for i in range(n):
    if a == 0:
        multi = 0
        break

    multi *= n_list[i]

    if multi>1e18:
        break

if multi<=1e18:
    print(multi)
else:
    print((-1))
# Original solution
from sys import stdin

N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
res = 1
for i in range(N):
  res *= A[i]

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


print(res)

# Optimized solution
from sys import stdin

N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
A.sort()
res = 1
if 0 in A:
  res = 0
else:
  for i in range(N):
    res *= A[i]
    if res > 10**18:
      res = -1
      break

print(res)
# Original solution
# -*- coding: utf-8 -*-
N = int(eval(input()))
A_list = list(map(int, input().split()))
ans = 1
for i in range(N):
    ans *= A_list[i]

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

# Optimized solution
# -*- coding: utf-8 -*-
N = int(eval(input()))
A_list = list(map(int, input().split()))

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

ans = 1

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

print(ans)
# Original solution
N = eval(input())
A = tuple(map(int,input().split()))
N = 1
for i in range(len(A)):
    N *= A[i]

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

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

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

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

    print(f'{ans}')


if __name__ == '__main__':
    main()

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

    print(f'{ans}')


if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
a_list = [int(x) for x in input().split()]
ans = 1
for a in a_list:
    ans *= a
print((ans if ans <= 10 ** 18 else -1))

# Optimized solution
n = int(eval(input()))
a_list = sorted([int(x) for x in input().split()], reverse=True)

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

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


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

result = 1
for an in a:
    result *= an

max = 10 ** 18
if result > max:
    result = -1

print(result)


# Optimized solution
def calc(a, n):
    for x in range(n):
        if a[x] == 0:
            return 0

    result = 1
    max = 10 ** 18
    for x in range(n):
        result *= a[x]
        if result > max:
            return -1

    return result

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

print((calc(a, n)))
# Original solution
n=int(eval(input()))

a=[]


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


c=int(a[0])

for k in range(1,n):

    c*=int(a[k])

if c>10**18:
    print((-1))

else:
    print(c)


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

a=[]

import sys

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


c=1
if a.count(0)>=1:
    print((0))
    sys.exit()

for k in range(n):

    c*=int(a[k])

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


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

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

for i in sorted(ln):
    if a > 10**18 or a == 0:
        break
    else:
        a = a*i
        
    
    
if a> 10**18:
    print('-1')
else :
    print(a)
# Original solution
N = int(eval(input()))
AList = input().split()
result = 1

for element in AList:
    result = result * int(element)
   
if result > 1e+18:
    print((-1))
else:
    print(result)

# Optimized solution
import sys

N = int(eval(input()))
AList = input().split()

result = 1

if "0" in AList:
    print((0))
    sys.exit()
    
for element in AList:
    result = result * int(element)

    if result > 1e+18:
        print((-1))
        sys.exit()

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

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

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

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

ans = 1

for i in a:
    ans = 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
a.sort()

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

if ans > 10**18:
    ans = -1
    
print(ans)
# 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 0 in A:
  print((0))
  exit()
for a in A:
  ans *= a
  if ans > 10**18:
    print((-1))
    exit()

print(ans)
# Original solution
from functools import reduce
N = int(eval(input()))
listA = list(map(int, input().split()))

result = reduce(lambda x, y: x*y, listA)
if result > 10 ** 18:
	print((-1))
else:
	print(result)

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

if 0 in listA:
    print((0))
    exit()
result = 1
maxA = 10 ** 18
for a in listA:
    result *= a
    if result > maxA:
        result = -1
        break
print(result)
# Original solution
import functools
import operator

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

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

print(ans)
    


# Optimized solution
n=int(eval(input()))
lst=list(map(int, input().split()))
ans = 1
if 0 in lst:
    print((0))
    exit()

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


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

# Optimized solution
import sys
n = int(eval(input()))
a = [int(i) for i 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))
      exit()
  print(ans)
# Original solution
from functools import reduce
from operator import mul

N = int(eval(input()))

A = [int(i) for i in input().split()]

if 0 in A:
  print((0))
  exit();
  
B = reduce(mul,A)

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

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

A = sorted([int(i) for i in input().split()],reverse=True)

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

x = A[0]  
for i in A[1:]:
  x *= i
  if x > 10**18:
    print('-1')
    exit();
    
print(x)
# Original solution
n = eval(input())
a = list(map(int,input().split()))
sum = 1
for i in a:
    sum*=i

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

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

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

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

if 0 in A:
    ans = 0

else:
    for i in range(len(A)):
        ans = ans * A[i]
        if ans > 10 ** 18:
            error = str(ans)
            ans = '-1'
            break
print(ans)
# Original solution
n = int(eval(input()))

num = list(input().split())
ans = 1
for i in num:
    ans *= int(i)
    n *= len(i)

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



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

num = list(input().split())
ans = 1
if '0' in num :
    ans = 0
else:
    for i in num:
        ans *= int(i)
        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()))
count = 1
for i in range(N):
    count = count * A[i]
if count > 10 ** 18:
    print((-1))
else:
    print(count)

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
if 0 in A:
    print((0))
else:
    count = 1
    flag = True
    for i in range(N):
        count = count * A[i]
        if count > 10 ** 18:
            print((-1))
            flag = False
            break
    if flag:
        print(count)
# Original solution
n = int(eval(input()))
a = [int(x) for x in 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 = [int(x) for x in input().split()]
a.sort()
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        print((-1))
        exit()
print(ans)
# Original solution
def getN():
    return int(eval(input()))
def getNM():
    return list(map(int, input().split()))
def getList():
    return list(map(int, input().split()))

from collections import defaultdict, deque
from sys import exit
import math
import copy
from bisect import bisect_left, bisect_right
from heapq import *
import sys
# sys.setrecursionlimit(1000000)
INF = 10 ** 17
MOD = 1000000007

from fractions import *
def inverse(f):
    # return Fraction(f.denominator,f.numerator)
    return 1/f


def combmod(n, k, mod=MOD):
    ret = 1
    for i in range(n - k + 1, n + 1):
        ret *= i
        ret %= mod

    for i in range(1, k + 1):
        ret *= pow(i, mod - 2, mod)
        ret %= mod

    return ret
def bunsu(n):
    ret = []
    for i in range(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            tmp = 0
            while(True):
                if n % i == 0:
                    tmp += 1
                    n //= i
                else:
                    break
            ret.append((i, tmp))

    ret.append((n, 1))
    return ret

def solve():
    lim = 10 ** 18
    n = getN()
    nums = getList()
    if 0 in nums:
        print((0))
        return
    ans = 1
    for num in nums:
        ans *= num
        if ans > lim:
            print((-1))
            return

    print(ans)
def main():
    # n = getN()
    # for _ in range(n):
    solve()
if __name__ == "__main__":
    solve()


# Optimized solution
def getN():
    return int(eval(input()))


def getNM():
    return list(map(int, input().split()))


def getList():
    return list(map(int, input().split()))


from collections import defaultdict, deque
from sys import exit
import math
import copy
from bisect import bisect_left, bisect_right
from heapq import *
import sys

# sys.setrecursionlimit(1000000)
INF = 10 ** 17
MOD = 1000000007

from fractions import *


def inverse(f):
    # return Fraction(f.denominator,f.numerator)
    return 1 / f


def combmod(n, k, mod=MOD):
    ret = 1
    for i in range(n - k + 1, n + 1):
        ret *= i
        ret %= mod

    for i in range(1, k + 1):
        ret *= pow(i, mod - 2, mod)
        ret %= mod

    return ret


def bunsu(n):
    ret = []
    for i in range(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            tmp = 0
            while (True):
                if n % i == 0:
                    tmp += 1
                    n //= i
                else:
                    break
            ret.append((i, tmp))

    ret.append((n, 1))
    return ret

MOD = 998244353
def solve():
    n = getN()
    nums = getList()

    if 0 in nums:
        print((0))
        return
    ans = 1
    for num in nums:
        ans *= num
        if ans > 10 ** 18:
            print((-1))
            return

    print(ans)
def main():
    n = getN()
    for _ in range(n):
        solve()


if __name__ == "__main__":
    solve()
# Original solution
N, *a = list(map(int, open(0).read().split()))

ans = 1
for x in a:
    ans = ans * x
    if ans == 0:
      print((0))
      exit()

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


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

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

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

print(ans)
# Original solution
import functools
import operator


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

prod = functools.partial(functools.reduce, operator.mul)
if 10 ** 18 < prod(A):
    print((-1))
else:
    print((prod(A)))

# Optimized solution
def ans(a):
    ans = 1
    if 0 in a:
        return 0
    for i in A:
        ans *= i
        if 10 ** 18 < ans:
            ans = -1
            return ans
    return ans


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

print((ans(A)))
# 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(0)
for i in range(N):
    ans *= A[i]
    if ans > 10**18:
        print((-1))
        break
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
import sys
N=int(eval(input()))
A=list(map(int,input().split()))
A.sort()
ans=1
for i in range(N):
  ans*=A[i]
  if ans>10**18:
    print((-1))
    sys.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 > 1000000000000000000:
    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 a:
        ans *= i
        if ans > 1000000000000000000:
            print((-1))
            exit()

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

# Optimized solution
def main():
    N = int(eval(input()))
    A = list(map(int,input().split()))
    C = 1
    if 0 in A:
        print((0))
    else:
        for i in range(N):
            C *= A[i]
            if C > 10**18:
                C = '-1'
                break
            
        print(C)
    
if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
a_list = list(map(int,input().split()))
ans = 1
for i in a_list:
    ans *= i
if ans <= 10**18:
    print(ans)
else:
    print((-1))

# Optimized solution
n = int(eval(input()))
a_list = list(map(int,input().split()))
if 0 in a_list:
    print((0))
    exit()
ans = 1
for i in a_list:
    ans *= i
    if ans > 10**18:
        print((-1))
        exit()
print(ans)
# Original solution
# -*- coding: utf-8 -*-
import math
n = int(eval(input()))
a = list(map(int, input().split()))
res = 1 
if min(a) == 0:
  res = 0
else:
  for i in range(len(a)):
    res *= a[i]
    if res > 1000000000000000000:
      res = -1
      continue
print(res)

# Optimized solution
# -*- coding: utf-8 -*-
import math
n = int(eval(input()))
a = list(map(int, input().split()))
res = 1 
if 0 in a:
  res = 0
else:
  for num in a:
    res *= num
    if res > 10**18:
      res = -1
      break
print(res)
# Original solution
# -*- coding: utf-8 -*-
import math
n = int(eval(input()))
a = list(map(int, input().split()))
res = 1 
if 0 in a:
  res = 0
else:
  for num in a:
    res *= num
    if res > 10**18:
      res = -1
      break
print(res)

# Optimized solution
# -*- coding: utf-8 -*-
n = int(eval(input()))
a = list(map(int, input().split()))
res = 1 
if 0 in a:
  res = 0
else:
  for num in a:
    res *= num
    if res > 10**18:
      res = -1
      break
print(res)