CodeEff/ECCO huggingface dataset:
# Original solution
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return list(map(int, sys.stdin.readline().split()))
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))
from decimal import Decimal
'''
N = ii()
A = li()
ans = 1
for num in A:
    ans *= num
    if ans > 10**18:
        if 0 in A:
            print(0)
        else:
            print(-1)
        exit()

print(ans)
'''

N = ii()
A = li()
ans = 1
inf = Decimal('1000000000000000000')

for num in A:
    if ans <= inf / Decimal(str(num)):
        ans *= num
    else:
        if 0 in A:
            print((0))
        else:
            print((-1))
        exit()

print(ans)

# Optimized solution
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return list(map(int, sys.stdin.readline().split()))
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))
from decimal import Decimal
'''
N = ii()
A = li()
ans = 1
for num in A:
    ans *= num
    if ans > 10**18:
        if 0 in A:
            print(0)
        else:
            print(-1)
        exit()

print(ans)
'''

'''
N = ii()
A = li()
ans = 1
inf = Decimal('1000000000000000000')
for num in A:
    if ans <= inf / Decimal(str(num)):
        ans *= num
    else:
        if 0 in A:
            print(0)
        else:
            print(-1)
        exit()
print(ans)
'''

N = ii()
A = li()
if 0 in A:
    print((0))
    exit()
ans = 1
for num in A:
    if ans < (10**18+1) / num or ans == 10**18//num:
        ans *= num
    else:
        print((-1))
        exit()
 
print(ans)
# Original solution
n = int(eval(input()))

ans = 1
flag = True
a = list(map(int, input().split()))
for i in a:
    ans *= i
    if ans > 1000000000000000000:
        flag = False

if ans == 0:
    flag = True

if flag:
    print(ans)
else:
    print((-1))


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

ans = 1
flag = True
a = list(map(int, input().split()))

a.sort()

if a[0] == 0:
    print((0))
    exit(0)

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

print(ans)
# Original solution
n = int(eval(input()))
nums = list(map(int, input().split()))
sum = 1
flag = 1
upper = pow(10, 18)
for num in nums:
  sum = sum * num
  if sum > upper:
    flag = 2
  if num == 0:
    sum = 0
    flag = 0
if flag == 0:
  print((0))
elif flag == 1:
  print(sum)
elif flag == 2:
  print((-1))

# Optimized solution
n = int(eval(input()))
nums = list(map(int, input().split()))
sum = 1
flag = 1
upper = pow(10, 18)
for num in nums:
  if num == 0:
    sum = 0
    flag = 1
    break
  if flag == 1:
    sum = sum * num
    if sum > upper:
      flag = 2

if flag == 1:
  print(sum)
elif flag == 2:
  print((-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
import sys
n = int(eval(input()))
A = list(map(int,input().split()))
if A.count(0)>0:
    print((0))
else:
    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()))
x = 1
for j in a:
    x = j*x
if x > 10**18:
    print((-1))
else:
    print(x)

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

# Optimized solution
N = int(eval(input()))
L = input().split()
 
 
def mult():
    if "0" in L:
        return 0
    else:
        a = 1
        for i in L:
            a = a * int(i)
            if a > 1000000000000000000:
                return -1
        return a
 
print((mult()))
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
def kake(a):
  res=1
  for i in a:
    res*=i
  if res > 10**18:
    return -1
  else:
    return res
print((kake(A)))

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
def kake(a):
  res=1
  for i in sorted(a):
    res*=i
    if res > 10**18:
      return -1
  else:
    return res
print((kake(A)))
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
b=A[0]

if(A.count(0)!=0):
    print('0')
    exit()

for i in range(1,len(A)):
    b=b*A[i]

if(10**18<b):

    print('-1')
    exit()

print(b)


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

if(A.count(0)!=0):
    print('0')
    exit()

for i in range(1,len(A)):
    b=b*A[i]
    if(10**18<b):

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

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

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
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10**18:
            print((-1))
            return
    print(ans)

if __name__ == "__main__":
    main()
# Original solution
n = int(eval(input()))
nums = list(map(int,input().split()))
ans = 0
ansa = nums[0]
ansz = nums[-1]
for i in range(1,n//2):
    ansa *= nums[i]
    ansz *= nums[-(i+1)]
if n%2==0:
    ans = ansa*ansz
else:
    ans = ansa*ansz*nums[n//2]
if ans <= 10**18:
    print(ans)
else:
    print('-1')

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

if b > 10**18:
    b = -1
print(b)

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

print(b)
# Original solution
n = int(eval(input()))
a_list = []

a_list = list(map(int,input().split()))
result = 1

for a in a_list:
    result *= a

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


# Optimized solution
import sys

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

if 0 in a:
    print((0))
else:
    cur = 1
    for x in a:
        cur *= x
        if cur > 10 ** 18:
            print((-1))
            sys.exit()
    print(cur)
# Original solution
import sys

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

if 0 in a:
    print((0))
else:
    cur = 1
    for x in a:
        cur *= x
        if cur > 10 ** 18:
            print((-1))
            sys.exit()
    print(cur)


# Optimized solution
import sys

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

if 0 in a_list:
    print((0))
    sys.exit()
else:
    cul = 1
    for a in a_list:
        cul *= a
        if cul > 10 ** 18:
            print((-1))
            sys.exit()
    print(cul)
# Original solution
import sys

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

if 0 in a_list:
    print((0))
    sys.exit()
else:
    cul = 1
    for a in a_list:
        cul *= a
        if cul > 10 ** 18:
            print((-1))
            sys.exit()
    print(cul)


# Optimized solution
import sys

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

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

cur = 1
for a in a_list:
  cur *= a
  if cur > 10 ** 18:
    print((-1))
    sys.exit()

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

ans = 1

exit
for i in a:
    ans *= i

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

for i in range(n):
    res = res * a[i]
    
if res > 1000000000000000000:
    res = -1

print(res)

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

if 0 not in a:

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

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

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

# Optimized solution
import sys
N = int(eval(input()))
A=list(map(int,input().split()))
A.sort()
maxi=10**18
ans=1
for i in A:
    ans*=i
    if ans==0:
        print((0))
        sys.exit()
    if ans>maxi:
        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=ans*i
x=10**18 
if ans>x:
	print((-1)) 
else:
	print(ans)

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

x=10**18 
flag=0;
for i in a:
	if i==0:
		flag=1
		break

for i in a:
	ans=ans*i
	if ans>x:
		break
if flag==1:
	ans=0
if ans>x :
	print((-1)) 
else:
	print(ans)
# Original solution
n=input()
list1=list(map(int,input().split()))
if 0 in list1:
    print(0)
else:
    ans=1
    for i in list1:
        ans*=i
    print(ans) if ans<=1e18 else print(-1)


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

# Optimized solution
def main():    
    N = int(eval(input()))
    a = list(map(int,input().split()))
    res = 1
    if 0 in a:
        print((0))
        return
    for i in a:
        res *= i
        if res > 10**18:
            print((-1))
            return
    print(res)
if __name__ == "__main__":
    main()
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

ans = 1

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

m = 10 ** 18

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


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

ans = 1

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

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


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

print(ans)
# Original solution
n =int(eval(input()))
A = list(map(int, input().split()))
 
s = A[0]
for i in range(1, n):
  s *=A[i]
 
if s <= 1000000000000000000:
  print(s)
elif s > 1000000000000000000:
  print((-1))

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

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

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

  print(p)
main()
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
res = 1
for i in a:
    res *= i
if res > 1000000000000000000:
        res = -1
print(res)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
res = 1
a.sort()
for i in a:
    res *= i
    if res > 1000000000000000000:
        res = -1
        break
print(res)
# Original solution
n = int(eval(input()))
ns = list(map(int, input().split()))

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

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

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

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

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

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
b = 1
c = 0
if A.count(0) != 0:
  print((0))
else:
  for i in range(N):
    b = b * A[i]
    if b > 10 ** 18:
      c = 1
      break
  if c == 0:
    print(b)
  else:
    print((-1))
# Original solution
import sys

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

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

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

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

if __name__ == '__main__':
    n = int(eval(input()))
    a = list(map(int,input().split()))
    print((solve(a)))

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

if __name__ == '__main__':
    n = int(eval(input()))
    a = list(map(int,input().split()))
    print((solve(a)))
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
ans = 1
for a in A:
    ans *= a
print((-1 if ans > 10**18 else ans))

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
if 0 in A:
    print((0))
    exit()
ans = 1
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()))

product = 1
for i in a:
    if i==0:
        product = 0
        break
    product *= i

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


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

product = 1

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

print(product)
# 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(ans)
else:
    print((-1))

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

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

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

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


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

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
a.sort()
t = 1
 
for i in range(len(a)):
  t *= a[i]
  if t > 10**18:
    break
 
if t > 10**18 :
  print("-1")
else:
  print((str(t)))
# Original solution
from functools import reduce
from operator import mul
import math

def main():
    n = int(eval(input()))
    l = list(map(int, input().split()))

    if 0 in l:
        print((0))
        return
    l_sorted = sorted(l, reverse=True)
    log = 0
    seki = 1
    for i in l_sorted:
        log += math.log10(i)
        if log > 18:
            print((-1))
            return
        elif log == 18:
            seki *= i
            if seki != 10 ** 18:
                print((-1))
                return
        else:
            seki *= i
    print(seki)
    return


if __name__ == '__main__':
    main()

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

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

    prod = 1
    for i in l:
        prod *= i
        if prod > 1000000000000000000:
            print((-1))
            return

    print(prod)

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

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

def manipulate(A_i):
    if 0 in A_i:
        return 0
    
    ans = 1
    
    for a in A_i:
        ans *= a
        if ans > 10 ** 18:
            return -1
    
    return ans

print((manipulate(A_i)))
# Original solution
n = int(eval(input()))
an = [int(num) for num in input().split()]

answer = an[0]
check = 10**18
for i in range(1,len(an)) :
  answer *= an[i]

if answer <= check:
  print(answer)
else :
  print((-1))

# Optimized solution
import sys

n = int(eval(input()))
an = [int(num) for num in input().split()]

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

answer = 1
check = 10**18
for i in range(len(an)) :
  answer *= an[i]
  if answer > check:
    print((-1))
    sys.exit()

print(answer)
# 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))
    exit()
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
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)


# 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))
            exit()
    print(ans)
# Original solution
def multiply(num_list):
  # if "0" in list, return 0
  if 0 in set(num_list):
    return 0
  
  # if res > 10^18: return -1
  MAX = pow(10,18)
  res = 1
  for i in num_list:
    res *= i
    if res == 0:
      return 0
    if res > MAX:
      return -1
  return res

eval(input())
num_list = list(map(int,input().split()))
print((multiply(num_list)))

# Optimized solution
def multiply(num_list):
  # if "0" in list, return 0
  if 0 in num_list:
    return 0
  
  # if res > 10^18: return -1
  MAX = pow(10,18)
  res = 1
  for i in num_list:
    res *= i
    if res > MAX:
      return -1
  return res

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

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

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

ans = 1
for n in a:
    ans*=n
    
    if ans > 10**18:
        ans = -1
        break
    
print(ans)
# Original solution
'''
Fuad Ashraful Mehmet
University of Asia Pacific,Bangladesh
Date:2nd june 2020
'''

def Solve():
    n=int(eval(input()))
    ar=[int(x) for x in input().split()]
    #print(ar)
    ans=1
    for x in ar:
        ans=ans*x
    print(("-1" if ans>10**18 else ans))
Solve()

# Optimized solution
'''
Fuad Ashraful Mehmet
University of Asia Pacific,Bangladesh
Date:2nd june 2020
'''

def Solve():
    n=int(eval(input()))
    ar=[int(x) for x in input().split()]
    if 0 in ar:
        print((0))
        exit()
    ans=1
    for x in ar:
        ans=ans*x
        if ans>10**18:
            print("-1")
            return
    print(ans)
Solve()
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
s=1
ans=0
for i in a:
  s=s*i
  if s>10**18:
    ans=1
   
  else:
    ans=0
    
if ans==1:
  print((-1))
  
else:
  print(s)

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

a.sort()
if a[0]==0:
  print((0))
  
else:
  s=1
  for i in a:
    s*=i
    if s>10**18:
      print((-1))
      exit()
      
  print(s)
# 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()))
lis = list(map(int,input().split()))
ans = 1
if 0 in lis:
  print((0))
  exit()
for num in lis:
  ans *= num
  if ans > 10 ** 18:
    print((-1))
    exit()
print(ans)