import sys
import math
import fractions
import bisect
import queue
import heapq
import collections
import itertools
sys.setrecursionlimit(4100000)

# 定数
MOD = int(1e9 + 7)
INF = 1e18
DX = [0,  0, 1, -1, 1,  1, -1, -1, 0]
DY = [1, -1, 0,  0, 1, -1,  1, -1, 0]
PI = 3.14159265358979323846264338327950288

"""=======　関数 ==============================================================="""
# 約数列挙(O(√n))
def divisor(n):
    ret = []
    for i in range(1, n+1):
        if i*i > n:
            break
        if n % i == 0:
            ret.append(i)
            if i*i != n:
                ret.append(n/i);
    return sorted(ret)

# エラトステネスの篩
def search_sosuu(n):
    sosuu = [True] * n
    sosuu[0] = sosuu[1] = False
    for i in range(2, n):
        if sosuu[i]:
            for j in range(2, n):
                if(i*j > n):
                    break
                else:
                    sosuu[i*j] = False
    return sosuu

# 素因数分解(O(√n))
def div_prime(n):
    prime_factor = []
    for i in range(2, n+1):
        if i*i > n:
            break
        count = 0
        while n % i == 0:
            count += 1
            n //= i
        if count:
            prime_factor.append((i, count))
    if n != 1:
        prime_factor.append((n, 1))
    return prime_factor

# 素数判定(O(√n))
def is_sosuu(n):
    if n < 2:
        return False
    elif n == 2:
        return True
    elif N%2 == 0:
        return False
    for i in range(3, int(math.sqrt(n)), 2):
        if n % i == 0:
            return False
    return True

# 最大公約数(O(logn))
def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    while r:
        a, b = b, r
        r = a % b
    return b

# 最小公倍数(O(logn))
def lcm(a, b):
    g = gcd(a, b)
    return g * (a//g) * (b//g)

# 階乗(O(n))
def factorial(n):
    if n <= 1:
        return 1
    return (n * factorial(n-1)) % MOD

# 高速コンビネーション計算(前処理:O(N) 計算:O(1))
MAX_COMB = 200005
fac = [0] * MAX_COMB
finv = [0] * MAX_COMB
inv = [0] * MAX_COMB
com_inited = False
def COMinit():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX_COMB):
        fac[i] = fac[i-1] * i % MOD
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD

    com_inited = True
def com(n, k):
    if not com_inited:
        COMinit()
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

# 繰り返し2乗法(O(logP))
def repeat_squaring(base, sisuu):
    if sisuu == 0:
        return 1
    if sisuu % 2 == 0:
        t = repeat_squaring(base, sisuu / 2) % MOD
        return t * t % MOD
    return base * repeat_squaring(base, sisuu - 1) % MOD

# 単発コンビネーション(O(logn))
def fast_com(a, b):
    bunshi = 1
    bunbo = 1
    for i in range(1, b + 1):
        bunbo *= i
        bunbo %= MOD

        bunshi *= (a - i + 1)
        bunshi %= MOD

    ret = bunshi * repeat_squaring(bunbo, MOD - 2) % MOD

    while ret < 0:
        ret += MOD
    return ret

# 2直線の交差判定
def is_cross(x1, y1, x2, y2, X1, Y1, X2, Y2):
    dx_ai = X1 - x1;
    dy_ai = Y1 - y1;
    dx_bi = X1 - x2;
    dy_bi = Y1 - y2;
    
    dx_ai2 = X2 - x1
    dy_ai2 = Y2 - y1
    dx_bi2 = X2 - x2
    dy_bi2 = Y2 - y2

    si = dx_ai * dy_bi - dy_ai * dx_bi
    si2 = dx_ai2 * dy_bi2 - dy_ai2 * dx_bi2
    
    si3 = dx_ai * dy_ai2 - dy_ai * dx_ai2
    si4 = dx_bi * dy_bi2 - dy_bi * dx_bi2

    return si * si2 < 0 and si3 * si4 < 0

# 木の根からの深さ
def tree_depth(edge, start_node, n_node):
    dist = [INF] * n_node
    dist[start_node] = 0

    S = queue.LifoQueue()
    S.put((start_node, 0))

    while not S.empty():
        node, d = S.get()
        dist[node] = d

        for next in edge[node]:
            if d[next] == INF:
                S.put((next, d + 1))

    return dist


'''
1行のint=====================================
N, K = map(int, input().split())

1行のstring=================================
S, T = input().split()

1行の整数配列================================
P = list(map(int,input().split()))

改行あり整数==================================
X = []
Y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    X.append(x1)
    Y.append(y1)

A = []
for i in range(N):
    a=int(input())
    A.append(a)

Pair = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    Pair.append((x1, y1))
    
2次元整数配列=====================================
A = []
for i in range(N):
    tmp = list(map(int,input().split()))
    A.append(tmp)


N行M列の初期化====================================
dp = [[VAL] * RETU for i in range(GYO)]

'''



N = int(input())

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

ans = 1

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

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

print(ans)





Measured memory_bytes: 28456