CodeEff/ECCO huggingface dataset:
# Original solution
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(eval(input()))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(list(passedDic.items()), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()

a = LIST()

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

# Optimized solution
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(eval(input()))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(list(passedDic.items()), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()

a = LIST()
a.sort()
if(0 in a):
    print((0))
else:
    ans = 1
    for el in a:
        ans*=el
        if(ans>10**18):
            break
    if(ans>10**18):
        print((-1))
    else:
        print(ans)
# Original solution
import math
from collections import deque
from collections import defaultdict

import time

#自作関数群
def readInt():
	return int(eval(input()))
def readInts():
	return list(map(int, input().split()))
def readChar():
	return eval(input())
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list([int(x) for x in list((zero+bin(x)[2:])[-1*n:])]))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

n = readInt()
a = readInts()

ans = 1

d = defaultdict(int)

for i in a:
	d[i]+=1

for k in d:
	ans*=k**d[k]

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

# Optimized solution
import math
from collections import deque
from collections import defaultdict


#自作関数群
def readInt():
	return int(eval(input()))
def readInts():
	return list(map(int, input().split()))


n = readInt()
a = readInts()

ans = 1

d = defaultdict(int)

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

for i in a:
	d[i]+=1

for k in d:
	ans*=k**d[k]
	if ans>10**18:
		print((-1))
		exit()

else:
	print(ans)
# Original solution
N = int(eval(input()))
A = [int(i) for i in input().split()]

count = 1

for i in range(N):
    if A[i] == 0:
        print((0))
        exit()

    count *= A[i]

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

print(count)

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

count = 1

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

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

print(count)
# Original solution
def resolve():
    _ = eval(input())
    an = list(map(int, input().split()))

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

if __name__ == '__main__':
    resolve()

# Optimized solution
def resolve():
    _ = eval(input())
    an = sorted(map(int, input().split()), reverse=True)

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

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

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


# Optimized solution
N = int(eval(input()))
# = map(int, input().split())
A = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]
answer = A[0]

if A.count(0) > 0:
    print((0))
    exit()

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

if i > 1000000000000000000:
  i = -1
print(i)

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

for x in a:
  i *= x
  if i > 10 ** 18:
    break


if i > 10 ** 18:
  i = -1
print(i)
# Original solution
from functools import reduce
from operator import mul

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

m = reduce(mul, A)

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

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

mul = 1

A.sort()

for i in range(N):
  mul *= A[i]
  if mul == 0 or mul > 10 ** 18:
    break

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

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

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

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

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

print(prod)
# 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
import sys
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
if A[-1] == 0:
    print((0))
    sys.exit(0)
ans = A[0]
for i in range(1, N):
    ans *= A[i]
    if ans > 10**18:
        print((-1))
        sys.exit(0)
print(ans)
# Original solution
"""
~~ Author : Bhaskar
~~ Dated : 31~05~2020
"""

import sys
from bisect import *
from math import floor,sqrt,ceil,factorial as F,gcd,pi
from itertools import chain,combinations,permutations,accumulate
from collections import Counter,defaultdict,OrderedDict,deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
mod = 10**18
lcm = lambda a,b : (a*b)//gcd(a,b)
setbit = lambda x : bin(x)[2:].count("1")

def solve():
    n = int(sys.stdin.readline())
    a = list(map(int,sys.stdin.readline().split()))
    ans =  1
    flag = False
    for i in a:
        ans *= i
        # print(ans)
        if ans > mod:
            flag = True
            break
    if 0 in a:
        print((0))
    else:
        if not flag:
            print(ans)
        else:
            print((-1))

if __name__ == "__main__":
    solve()


# Optimized solution
"""
~~ Author : Bhaskar
~~ Dated : 13~06~2020
"""

import sys
from bisect import *
from math import floor, sqrt, ceil, factorial as F, gcd, pi
from itertools import chain, combinations, permutations, accumulate
from collections import Counter, defaultdict, OrderedDict, deque

INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize) - 1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a, b: (a * b) // gcd(a, b)
setbit = lambda x: bin(x)[2:].count("1")
INT = lambda type: type(sys.stdin.readline()) if type in [int, float] else type(sys.stdin.readline()).replace("\n", "")
ARRAY = lambda type: list(map(type, sys.stdin.readline().split()))
NUMS = lambda type: list(map(type, sys.stdin.readline().split()))


def solve():

    n = INT(int)
    a = ARRAY(int)
    if 0 in a:
        print((0))
    else:
        p = 1
        ok = False
        for i in a:
            p *= i
            if p > 10**18:
                ok = True
                break
        print((p if not ok else -1))



if __name__ == "__main__":
    # try:
    #     sys.stdin = open("input.txt", "r")
    # except:
    #     pass
    solve()
# Original solution
N = int(eval(input()))
A = list(input().split())
for i in range(N):
    A[i] = int(A[i])
sum = 1

for i in range(N):
    sum = sum * A[i]

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

# Optimized solution
N = int(eval(input()))
A = list(input().split())
flag = 0
for i in range(N):
    A[i] = int(A[i])
    if A[i] == 0:
        flag = -1
sum = 1

for i in range(N):
    if sum <= 10**18:
        sum = sum * A[i]
    else:
        break


if sum <= 10**18:
    print(sum)
else:
    if flag == -1:
        print((0))
    else:
        print((-1))
# Original solution
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 **18
N,*A = list(map(int, read().split()))
ans = 1
for i in A:
  ans *= i
if ans <=INF:
  print(ans)
else:
  print((-1))

# Optimized solution
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 **18
N,*A = list(map(int, read().split()))
if 0 in A:
  print((0))
  sys.exit()
ans = 1
for i in A:
  ans *= i
  if ans > INF:
    print((-1))
    sys.exit()
print(ans)
# Original solution
N = int(eval(input()))
A_list = list(map(int, input().split()))

n = 1
for i in A_list:
  if 0 in A_list:
    print((0))
    break
  n = n * i
  if n > 1000000000000000000:
    print((-1))
    break
else:
  print(n)

# Optimized solution
N = int(eval(input()))
A_list = list(map(int, input().split()))
A_list.sort(reverse=True)
n = 1
for i in A_list:
  if A_list[-1] == 0:
    print((0))
    break
  n = n * i
  if n > 1000000000000000000:
    print((-1))
    break
else:
  print(n)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
result=1
if 0 in a:
    print((0))
else:
    for i in a:
        result*=i
    if i>10**18:
        print((-1))
    elif result>10**18:
        print((-1))
    else:
        print(result)


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

if 0 in aa:
    print("0")
else:
    result = 1
    for a in aa:
        result *= a

    if result > pow(10, 18):
        result = -1

    print(result)


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

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

result = 1
for a in aa:
    result *= a
    if result > pow(10, 18):
        print('-1')
        exit(0)

print(result)
# Original solution
# -*- coding: utf-8 -*-
N = int(eval(input()))
numlist = list(map(int, input().split()))
if 0 < numlist.count(0):
    print('0')
    quit()

total = 1
for i in numlist:
  total *= i

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

# Optimized solution
# -*- coding: utf-8 -*-
N = int(eval(input()))
numlist = list(map(int, input().split()))
if 0 < numlist.count(0):
    print('0')
    quit()

total = 1
for i in numlist:
  total *= i
  if 10 ** 18 < total:
    print('-1')
    quit()

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

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

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

if result > 1e18:
    print((-1))
else:
    print(result)

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

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

result = 1
for a in list_A:
    result *= a
    if result > 1e18:
        print((-1))
        exit()

print(result)
# Original solution
if __name__ == '__main__':

	INF = 10**18
	
	n = int(eval(input()))
	A = list(map(int,input().split()))

	ans = 1
	flg = False

	for i in range(n):
		if A[i] == 0:
			ans = 0
			break
		ans = ans * A[i]

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


# Optimized solution
if __name__ == '__main__':

	INF = 10**18
	
	n = int(eval(input()))
	A = list(map(int,input().split()))

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

	ans = 1
	flg = False

	for i in range(n):
		ans = ans * A[i]
		if ans > INF:
			ans = -1
			break

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

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

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
def main():
    num_1 = eval(input())
    lis = list(input().split())
    s = 1
    num_2 = int (num_1)
    if 0 in lis:
        return 0
    for x in range(num_2):
        s = s * int(lis[x])
    if s > 10**18:
        return -1
    return s

print((main()))

# Optimized solution
def main():
    num_1 = eval(input())
    lis = list(map(int,input().split()))
    s = 1
    num_2 = int (num_1)
    num = 10 ** 18
    if 0 in lis:
        print((0))
        return
    for x in range(num_2):
        s = s * int(lis[x])
        if s > num:
            print((-1))
            return
    print(s)
    return

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

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

# Optimized solution
N = int(eval(input()))
numbers = [int(n) for n in input().split()]
mlt = 1
if 0 in numbers:
    print((0))
else:
    for n in numbers:
        mlt *= n
        if mlt > 1000000000000000000:
            mlt = -1
            break
    print(mlt)
# Original solution
n = int(input().strip())
a = list(map(int, input().split()))
ans = 1

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


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

if 0 in a:
    print((0))
else:
    for elem in a:
        ans *= elem
        if 10 ** 18 < ans:
            print((-1))
            exit()
    print(ans)
# Original solution
n = int(eval(input()))
re = 1

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

for i in range(n):
    re = re * li[i]
if re > 1000000000000000000:
    print((-1))
else:
    print(re)


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

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

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

# Optimized solution
n = int(eval(input()))
a = [int(i) for i in input().split()]
x = 1
f = 0
a.sort()
for i in range(n):
    #print(a[i])
    x = x*a[i]
    if x == 0:
        print((0))
        f = 1
        break
    elif x > 1000000000000000000:
        print((-1))
        f = 1
        break
if f == 0:
    print(x)
# Original solution
n = int(eval(input()))
ans = 1

nums = list([int(x) for x in input().split()])

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

print(ans)

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

nums = list([int(x) for x in input().split()])

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

print(ans)
# Original solution
n = int(eval(input()))
arr = []
p = 1
c = 0

a = list(map(int,input().strip().split()))[:n] 

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


# Optimized solution
n = int(eval(input()))
arr = []
p = 1
c = 0
l = 0
a = list(map(int,input().strip().split()))[:n] 

for i in range(n):
    if a[i]==0:
        c = 1
    if p > 1000000000000000000:  
        l = 1
    else:    
        p *= a[i]
if c == 1:
    print((0))
elif l == 1 or p > 1000000000000000000 :
    print((-1))
else:
    print(p)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

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

print(ans)


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

a.sort()

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


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

ans = 1

for a in A:
    ans *= a
    
    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()))

if 0 in A:
        ans = [0]
else:
    ans = [1]*N
    
    for i,a in enumerate(A):
        if i==0:
            ans[i] = a
        else:
            ans[i] = ans[i-1]*a

        if ans[i] > 10**18:
            ans[-1] = -1
            break
    
print((ans[-1]))
# 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
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            print((-1))
            break
    else:
      print(ans)
# Original solution
n = int(eval(input()))

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

total = 1
for i in List:
  total = total*i

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

# Optimized solution
n = int(eval(input()))
 
List = [int(i) for i in input().split()]
lst = sorted(List, reverse=True)
if lst[-1] == 0:
  print((0))
  exit()
total = 1
for i in lst:
  total = total*i
  if total > 1000000000000000000:
    print((-1))
    exit()
print(total)
# Original solution
N = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
for i in range(N):
    ans *= a[i]
    if ans == 0:
        break
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
    for i in range(N):
        ans *= a[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()))

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 min(a)==0:
    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()))
s = 1

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

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

print(s)

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

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

if 0 in a:
    s = 0

print(s)
# Original solution
import math
from functools import reduce


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

maxi = math.pow(10,18)
mult = reduce(lambda x,y: x*y, A)
    
if mult > maxi:
    print("-1")
else:
    print(mult)


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

main()