N = int(input())

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





def ans():

    if 0 in A:

        return print(0)

    product = 1

    for num in A:

        product = product * num

        if product > 10 ** 18:

            return print(-1)



    print(product)





ans()

N = int(eval(input()))

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



if 0 in A:

    print((0))

    exit()

product = 1

for num in A:

    product = product * num

    if product > 10 ** 18:

        print((-1))

        exit()



print(product)
N = int(input())
A = list(map(int, input().split()))


def ans():
    if 0 in A:
        return print(0)
    product = 1
    for num in A:
        product = product * num
        if product > 10**18:
            return print(-1)
    print(product)


ans()

N = int(eval(input()))
A = list(map(int, input().split()))
if 0 in A:
    print((0))
    exit()
product = 1
for num in A:
    product = product * num
    if product > 10**18:
        print((-1))
        exit()
print(product)

-N = int(input()) +N = int(eval(input())) - - -def ans(): -    if 0 in A: -        return print(0) -    product = 1 -    for num in A: -        product = product * num -        if product > 10**18: -            return print(-1) -    print(product) - - -ans() +if 0 in A: +    print((0)) +    exit() +product = 1 +for num in A: +    product = product * num +    if product > 10**18: +        print((-1)) +        exit() +print(product)