CodeEff/ECCO huggingface dataset:
# Original solution
def main():
    N = int(input())
    A = list(map(int,input().split()))
    
    if 0 in A:
        return print(0)
    prod = 1
    for n in A:
        prod *= n
    if prod > 1000000000000000000:
        prod = -1
    return print(prod)

main()


# Optimized solution
def main():
    N = int(input())
    A = list(map(int,input().split()))
    
    if 0 in A:
        return print(0)
    prod = 1
    for n in A:
        prod *= n
        if prod > 1000000000000000000:
            return print(-1)
    return print(prod)

main()
# Original solution
a1 = int(input())
b2 = input().split(" ")

def check(a , b):
  score = 1
  now = 10 ** 18
  if '0' in b:
    return print(0)
  else:
    for i in range(a):
      score *= int(b[i])
    if score > 10 ** 18:
      return print(-1)
    else:
      return print(score)

check(a1 , b2)


# Optimized solution
a1 = int(eval(input()))
b2 = input().split(" ")

def check(a , b):
  score = 1
  if '0' in b:
    return 0
  else:
    for i in range(a):
      score *= int(b[i])
      if score > 10 ** 18:
        return -1
    
    return score

print((check(a1 , b2)))
# Original 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:
    print(ans)
    exit(0)
else:
    print((-1))

# Optimized solution
import sys  # sys.exit()を使いたいので

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

if 0 in a:
# 0が1つでもあれば0です
    print((0))
else:
# 0がない場合
    cur = 1  # 現在の数値
    for x in a:
        cur *= x
        if cur > 10 ** 18:
        # 10**18を超えたので終了します
            print((-1))
            sys.exit()
    print(cur)  # 10**18以下なので、出力します
# 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 min(A) == 0:
  print((0))
  exit()
else:
  ans =1
for i in range(N-1):
  ans *= A[i]
  if ans > 10**18:
    print((-1))
    exit()
ans *= A[N-1]
if ans > 10**18:
  print((-1))
else:
  print(ans)
# Original solution
import operator
import functools
N=int(eval(input()))
A=list(map(int,input().split(' ')))
if functools.reduce(operator.mul, A, 1)>10**18:
    print((-1))
else:
    print((functools.reduce(operator.mul, A, 1)))

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split(' ')))
def mul(x):
    l=1
    if 0 in x:
        l=0
    else:   
        for i in x:
                l=l*i
                if l>10**18:
                    l=-1
                    break
    return l
print((mul(A)))
# Original solution
s = eval(input())
a = list(map(int, input().split()))

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

if result > pow(10, 18):
    print((-1))
    exit(0)
print(result)

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

for i in a:
    if i == 0:
        print((0))
        exit(0)

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

print(result)
# Original solution
import sys
sys.setrecursionlimit(10**6)

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
sys.setrecursionlimit(10**6)

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

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

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

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

ans = 0
for i in A:
    if ans != 0:
        ans = ans * i
    else:
        ans = i

if ans > 1000000000000000000:
    print("-1")
else:
    print(ans)


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

A.sort()
ans = 0

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

for i in A:
    if ans != 0:
        ans = ans * i
    else:
        ans = i
    if ans > 1000000000000000000:
        print("-1")
        exit()

print(ans)
# Original solution
N = int(eval(input()))
a = list(map(int,input().split()))
b = 1
for i in a:
  b = b * i
if b > 1000000000000000000:
  print('-1')
else:
  print(b)

# Optimized solution
n = int(eval(input()))
a = sorted(list(map(int, input().split())))
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        print("-1")
        break
else:
    print(ans)
# Original solution
def LI():
    return list(map(int, input().split()))

_ = int(eval(input()))
a = LI()
ans = 1
mod = pow(10, 18)

def main(ans):
    for i in a:
        ans *= i
        if ans == 0:
            break
    if ans > mod:
        ans = -1
    print(ans)


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

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

_ = int(eval(input()))
a = LI()
ans = 1
mod = pow(10, 18)

def main(ans):
    if 0 in a:
        ans = 0
    else:
        for i in a:
            ans *= i
            if ans > mod:
                ans = -1
                break
    print(ans)

if __name__ == "__main__":
    main(ans)
# Original solution
import sys
readline = sys.stdin.buffer.readline
n = int(readline())
a = list(map(int, readline().split()))
a.sort()
v = 1
for i in a:
  v *= i
  if v > 1000000000000000000:
    print((-1))
    break
  elif v == 0:
    print((0))
    break
else:
  print(v)

# Optimized solution
import sys
readline = sys.stdin.buffer.readline
n = int(readline())
a = list(map(int, readline().split()))
v = 1

if min(a) == 0:
  print((0))
else:
  for i in a:
    v *= i
    if v > 1000000000000000000:
      print((-1))
      break
  else:
    print(v)
# 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()))
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()))
A = list(map(int, input().split()))
ans = 1

limit = pow(10,18)

f = 0
for i in range(N):
    if A[i] != 0:
        ans *= A[i]
    else:
        print((0))
        exit()

    if ans > limit:
        f = 1

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


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

limit = pow(10,18)

f = 0
for i in range(N):
    if A[i] != 0 and f == 0:
        ans *= A[i]
    elif A[i] != 0:
        pass
    else:
        print((0))
        exit()

    if ans > limit:
        f = 1

if f == 1:
    print((-1))
else:
    print(ans)
# Original 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 ans > 10 ** 18:
            ans = -1   
        else:
            pass
    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):
        if ans > 10 ** 9:
            if A[i] >= 10 ** 9:
                ans = -1
                break
            else:
                pass
        else:
            pass
        ans *= A[i]
        if ans > 10 ** 18:
            ans = -1
            break
        else:
            pass
    print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split(' ')))
r = 1
for i in a:
    r *= i
r = -1 if r > 10 ** 18 else r
print(r)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split(' ')))
o = 10 ** 18
r = 1
if 0 not in a:
    for i in a:
        r *= i
        if r > o:
            r = -1
            break
else:
    r = 0
print(r)
# Original solution
def I(): return int(eval(input()))
def LI(): return list(map(int,input().split()))
def MI(): return list(map(int,input().split()))
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]
n = I()
li = LI()
ans = 1
for k in li:
  ans = ans*k
if ans > 10**18:
  print((-1))
else:
  print(ans)

# Optimized solution
def I(): return int(eval(input()))
def LI(): return list(map(int,input().split()))
def MI(): return list(map(int,input().split()))
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]
n = I()
li = LI()
ans = 1
if 0 in li:
  print((0))
else:
  for k in li:
    ans *= k
    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 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')
else:
  for a in A:
    ans *= a
    if ans > 10**18:
      print('-1')
      exit()
  print(ans)
# Original solution
n=int(eval(input()))
A=list(map(int,input().split()))
ans=1
LIMIT=10**18
for i in range(n):
  ans*=A[i]
if ans>LIMIT:
  ans=-1
print(ans)


# Optimized solution
n=int(eval(input()))
A=list(map(int,input().split()))
ans=1
LIMIT=10**18

if 0 in A:
  print((0))
else:
  for i in range(n):
    ans*=A[i]
    if ans>LIMIT:
      ans=-1
      break
  print(ans)
# Original solution
n=int(eval(input()))
a=list(map(int, input().split()))
ans = 1
if a.count(0)>0:
    print((0))
    exit()
for i in range(n):
    l = len(str(ans))
    L = len(str(a[i]))
    if a[i] > 10**18:
        print((-1))
        exit()
    elif l+L > 20:
        print((-1))
        exit()
    ans *= a[i]
    if ans > 10**18:
        print((-1))
        exit()
print(ans)

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

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

# Optimized solution
n = int(eval(input()))
ans = int(1)
a = input().split(" ")

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

for i in num:
  a *= i
  
if a > 10**18:
    a = -1

print(a)

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

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

for number in A:
  result = result * number
  
if result > 1000000000000000000:
  print((-1))  
  
else:
  print(result)
  

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

if 0 in A:
    print((0))

else:
  for number in A:
    result = result * number
    
    if result > 1000000000000000000:
      result = -1
      break
    
  print(result)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
val = 1
for i in a:
	val*=i
if(val>1000000000000000000):
	print((-1))
else:
	print(val)

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
val = 1
exceed = 0
for i in a:
	if(exceed==0 or i==0):
		val*=i
	if(val==0):
		print((0))
		exit(0)
	if(val>1000000000000000000):
		exceed=1
if(exceed==0):
	print(val)
else:
	print((-1))
# Original solution
N = int(eval(input()))

A = tuple(map(int,input().split()))
if 0 in A:
    print((0))
else:
    p = 1
    for a in A:
        p *= a
        if p > 10**18:
            p = -1
            break

    print(p)

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

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

result = reduce(operator.mul, [int(x) for x in input().split()], 1)
if result > 10 ** 18:
  print((-1))
else:
  print(result)

# Optimized solution
eval(input())

result = 1
a = [int(x) for x in input().split()]
if 0 in a:
  print((0))
  exit()

for x in a:
  if result > 10 ** 18:
    print((-1))
    exit()
  result *= x
  
if result > 10 ** 18:
  print((-1))
else:
  print(result)
# 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()))
a = sorted(a)
ans = 1
for i in range(n):
    ans *= a[i]
    if ans == 0:
        break
    if ans > 10**18:
        ans = -1
        break

print(ans)
# Original solution
N = int(eval(input()))
p = [int(i) for i in input().split()]
ans = 1

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

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

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

if 0 in p:
  print((0))
  exit()
  
for i in range(N):
  ans*=p[i]
  if ans > 10 ** 18:
    print((-1))
    exit()
print(ans)
# Original solution
#B
N=int(eval(input()))
ans=1
for x in input().split():
    ans*=int(x)

if ans>pow(10,18):
    print("-1")
else:
    print(ans)

# Optimized solution
#B
N=int(eval(input()))
ans=1
flag=True
A=[]
for x in input().split():
    A.append(int(x))
    if int(x)==0:
        ans=0

for i in range(N):
    x=A[i]
    ans*=x
    if ans>pow(10,18):
        flag=False
        break

if flag:
    print(ans)
else:
    print("-1")
# Original solution
N = int(eval(input()))
As = list(map(int, input().split()))
ans = 1
for n in range(N):
    ans *= As[n]
if ans <= 1e18:
    print((int(ans)))
else:
    print((-1))

# Optimized solution
N = int(eval(input()))
As = list(map(int, input().split()))
if 0 in As:
    print((0))
else:
    As = sorted(As, reverse=True)
    ans = 1
    break_flag = 0
    for n in range(N):
        ans *= As[n]
        if ans > 1e18:
            print((-1))
            break_flag = 1
            break
    if break_flag == 0:
        print(ans)
# Original solution
n = int(eval(input()))
a = [int(i) for i in input().split()]
tmp = 1
for i in range(n):
    tmp *= a[i]

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


# Optimized solution
n = int(eval(input()))
a = [int(i) for i in input().split()]
tmp = 1
flg = 1
if 0 in a:
    print((0))
else:
    for i in a:
        tmp *= i
        if tmp > 10**18:
            flg = 0
            break
    if flg:
        print(tmp)
    else:
        print((-1))
# Original solution
# -*- coding: utf-8 -*-
import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A):
    ans = 1
    A.sort()
    for a in A:
        ans *= a

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


def main():
    N = read_int()
    A = read_int_n()
    print(slv(N, A))


if __name__ == '__main__':
    main()


# Optimized solution
# -*- coding: utf-8 -*-
import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A):
    ans = 1
    A.sort()
    for a in A:
        ans *= a
        if ans > 10**18:
            return -1
    return ans


def main():
    N = read_int()
    A = read_int_n()
    print(slv(N, A))


if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
A = [int(x) for x in input().split()]
ans = 1
for r in range(N):
  ans *= A[r]
if ans > 1e18:
    ans = -1
print(ans)

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

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


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

ans=1

for num in a:
    ans*=num

Inf=10**18

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

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

Inf=10**18

if zero>=1:
    print((0))
else:
    ans=1
    a.sort(reverse=True)
    for num in a:
        ans*=num
        if ans>Inf:
            print((-1))
            exit()
    
    print(ans)
# Original solution
LIMIT = 1000000000000000000

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

for e in A:
    answer *= e

if answer > LIMIT:
    print((-1))
else:
    print(answer)



# Optimized solution
LIMIT = 1000000000000000000

def main():
    N = int(eval(input()))  # 文字列または整数(一変数)
    a = list(map(int, input().split()))  # 整数のリスト
    answer = 1

    for i in range(N):
        answer *= a[i]
        if answer > LIMIT:
            if 0 in a[i:]:
                print((0))
                return
            else:
                print((-1))
            return

    print(answer)

if __name__ == '__main__':
    main()
# Original solution
a=int(eval(input()))
b=list(map(int,input().split()))
c=1
for i in range(a):
    c*=b[i]
if c>1000000000000000000:
    print((-1))        
else:
    print(c)

# Optimized solution
a=int(eval(input()))
b=list(map(int,input().split()))
c=1
b.sort()
if 0 in b:
    print((0))
else:
    b.sort(reverse=True)
    for i in range(a):
        c*=b[i]
        if c>1000000000000000000:
            print((-1))        
            break
    else:
        print(c)
# Original solution
eval(input())
A=list(map(int,input().split()))
r=1
for a in A:
  r*=a
if r>10e17:
  print((-1))
else:
  print(r)

# Optimized solution
eval(input())
A=list(map(int,input().split()))
r=1
if 0 not in A:
  for a in A:
    r*=a
    if r>10e17:
      print((-1))
      break
  else:
    print(r)
else:
  print((0))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
flag =0
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
flag =0
for i  in a:
    if i == 0:
        flag=2
        break
if flag!= 2:
    for i  in a:
        ans = ans*i
        if ans > 10 ** 18:
            flag=1
            break


if flag==1:
    print((-1))
elif flag ==2:
    print((0))
else:
    print(ans)
# Original solution
eval(input())
ans=1
for i in sorted(map(int,input().split())):
    ans*=i
    if ans==0:break
print((int(ans)if ans<=10**18 else -1))

# Optimized solution
eval(input())
ans=1
for i in sorted(map(int,input().split())):
    ans*=i
    if ans>10**18:ans=-1
    if -1<=ans<=0:break
print((int(ans)))
# Original solution
from operator import mul
from functools import reduce

def main ():
  count = int(eval(input()))
  c = list(map(int,input().split()))

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

  a = reduce(mul, c)

  if a > 1000000000000000000:
    print((-1))
    return
  else:
    print(a)

main()

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

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

  result = 1
  for a in c:
    result *= a
    if result > 1000000000000000000:
      print((-1))
      return

  print(result)

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

mul = 1
for ele in a:
    mul *= ele
print((mul if mul <= 1e18 else -1))

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

mul = 1
if 0 in set(a): mul = 0
else:
    iter = 0
    for i in range(n):
        mul *= a[i]
        if mul > 1e18:
            mul = -1
            break
print(mul)
# Original solution
from functools import reduce
N = int(eval(input()))
A = list(map(int, input().split()))
B = reduce((lambda x, y : x*y), A)
if B > 10**18:
  print((-1))
else:
  print(B)


# Optimized solution
from functools import reduce
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
if A[0] == 0:
    print((0))
else:
    p = 1;
    for i in range(N):
        p *= A[i];
        if p > 10**18:
            p = -1;
            break;
    print(p)
# Original solution
n = int(eval(input()))
A = [int(i) for i in input().split()]
product = 1

for i in range(n):
  product *= A[i]

if(product - 10**18 > 0):
    print("-1")
else:
  print(product)

# Optimized solution
n = int(eval(input()))
A = [int(i) for i in input().split()]
product = 1
A.sort()

for i in range(n):
  product *= A[i]
  if(product > 10**18):
    print("-1")
    break

if(product <= 10**18):
  print(product)
# Original solution
n = int(eval(input()))
l = list(map(int, input().split()))
ans = 1
for a in l:
    if ans * a > 1e18:
        ans = -1
    else:
        ans *= a

print(ans)

# Optimized solution
n = int(eval(input()))
l = list(map(int, input().split()))
ans = 1
for a in l:
    if ans * a > 1e18:
        ans = -1
    elif ans != -1 or a == 0:
        ans *= a

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

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

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

# Optimized solution
#A,B,C=(int(x) for x in input().split())
N=int(eval(input()))
A=list(map(int, input().split()))


if 0 in A:
  t=0
else:
  t=A[0]
  i=1
  for k in range(N-1):
    t=t*A[i]
    if t>10**18:
      break
    i+=1

if t<=10**18:
  print(t)
else:
  print((-1))
# Original solution
n = int(eval(input()))
li = list(map(int, input().split()))

ans = 1

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

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

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

print(ans)