def solve():

    N = int(eval(input()))

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

    if 0 in A:

        return 0

    prod = 1

    for i in range(N):

        if 10**18//prod < A[i]:

            return -1

        prod *= A[i]

    return prod

print((solve()))
def solve():

    n = int(eval(input()))

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



    ans = 1

    if 0 in a: return 0

    for i in a:

        ans *= i

        if ans > int(1e18): return -1

    

    

    return ans

    



print((solve()))

def solve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    if 0 in A:
        return 0
    prod = 1
    for i in range(N):
        if 10**18 // prod < A[i]:
            return -1
        prod *= A[i]
    return prod


print((solve()))

def solve():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    ans = 1
    if 0 in a:
        return 0
    for i in a:
        ans *= i
        if ans > int(1e18):
            return -1
    return ans


print((solve()))

-    N = int(eval(input())) -    A = list(map(int, input().split())) -    if 0 in A: +    n = int(eval(input())) +    a = list(map(int, input().split())) +    ans = 1 +    if 0 in a: -    prod = 1 -    for i in range(N): -        if 10**18 // prod < A[i]: +    for i in a: +        ans *= i +        if ans > int(1e18): -        prod *= A[i] -    return prod +    return ans