N = int(eval(input()))

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

A.sort()



ans = 1



for i in range(N):

    ans *= A[i]

    if ans>10**18:

        ans = -1

        break

print(ans)
# B - Multiplication 2

N = int(eval(input()))

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



def ans():

    global N,A

    for i in range(N):

        if A[i]==0:

            return 0

    tmp = 1

    for i in range(N):

        tmp *= A[i]

        if tmp>10**18:

            return -1

    return tmp



print((ans()))
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
ans = 1
for i in range(N):
    ans *= A[i]
    if ans > 10**18:
        ans = -1
        break
print(ans)

# B - Multiplication 2
N = int(eval(input()))
A = list(map(int, input().split()))


def ans():
    global N, A
    for i in range(N):
        if A[i] == 0:
            return 0
    tmp = 1
    for i in range(N):
        tmp *= A[i]
        if tmp > 10**18:
            return -1
    return tmp


print((ans()))

+# B - Multiplication 2 -A.sort() -ans = 1 -for i in range(N): -    ans *= A[i] -    if ans > 10**18: -        ans = -1 -        break -print(ans) + + +def ans(): +    global N, A +    for i in range(N): +        if A[i] == 0: +            return 0 +    tmp = 1 +    for i in range(N): +        tmp *= A[i] +        if tmp > 10**18: +            return -1 +    return tmp + + +print((ans()))