N = int(eval(input()))

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

A.sort()

if A[0] == 0:

    print((0))

else:

    ans = 1

    for a in A:

        ans *= a

        th = 10**18

        if ans > th:

            print((-1))

            exit(0)

    print(ans)
n = int(eval(input()))

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



if 0 in a:

    print((0))

    exit(0)



m = 10**18

ans = 1

for x in a:

    ans *= x

    if ans > m:

        print((-1))

        exit(0)

 

print(ans)



N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
if A[0] == 0:
    print((0))
else:
    ans = 1
    for a in A:
        ans *= a
        th = 10**18
        if ans > th:
            print((-1))
            exit(0)
    print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
if 0 in a:
    print((0))
    exit(0)
m = 10**18
ans = 1
for x in a:
    ans *= x
    if ans > m:
        print((-1))
        exit(0)
print(ans)

-N = int(eval(input())) -A = list(map(int, input().split())) -A.sort() -if A[0] == 0: +n = int(eval(input())) +a = list(map(int, input().split())) +if 0 in a: -else: -    ans = 1 -    for a in A: -        ans *= a -        th = 10**18 -        if ans > th: -            print((-1)) -            exit(0) -    print(ans) +    exit(0) +m = 10**18 +ans = 1 +for x in a: +    ans *= x +    if ans > m: +        print((-1)) +        exit(0) +print(ans)