n = int(eval(input()))

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



while len(arr) > 1:

    m = len(arr)

    if m & 1:

        arr.append(1)

        m += 1



    left, right = arr[:m // 2], arr[m // 2:]

    arr = [x * y for x, y in zip(left, right)]



x = arr[0]

if x > 10 ** 18:

    print((-1))

else:

    print(x)

n = int(eval(input()))

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



if 0 in arr:

    print((0))

    exit(0)



prod = 1

for a in arr:

    prod *= a

    if prod > 1000000000000000000:

        print((-1))

        exit(0)



print(prod)

n = int(eval(input()))
arr = list(map(int, input().split()))
while len(arr) > 1:
    m = len(arr)
    if m & 1:
        arr.append(1)
        m += 1
    left, right = arr[: m // 2], arr[m // 2 :]
    arr = [x * y for x, y in zip(left, right)]
x = arr[0]
if x > 10**18:
    print((-1))
else:
    print(x)

n = int(eval(input()))
arr = list(map(int, input().split()))
if 0 in arr:
    print((0))
    exit(0)
prod = 1
for a in arr:
    prod *= a
    if prod > 1000000000000000000:
        print((-1))
        exit(0)
print(prod)

-while len(arr) > 1: -    m = len(arr) -    if m & 1: -        arr.append(1) -        m += 1 -    left, right = arr[: m // 2], arr[m // 2 :] -    arr = [x * y for x, y in zip(left, right)] -x = arr[0] -if x > 10**18: -    print((-1)) -else: -    print(x) +if 0 in arr: +    print((0)) +    exit(0) +prod = 1 +for a in arr: +    prod *= a +    if prod > 1000000000000000000: +        print((-1)) +        exit(0) +print(prod)