import sys

N = int(eval(input()))



b = 1



a = sorted(list(map(int, input().split())), reverse=True)

if a[-1] == 0:

    print("0")

    sys.exit()

for i in a:

    b *= i

    if b > pow(10, 18):

        print("-1")

        sys.exit()

print(b)



        

import sys

N = int(eval(input()))

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

total = 1



if '0' in a:

    print('0')

    sys.exit()

for i in a:

    total *= int(i)

    if total > 10**18:

        print('-1')

        sys.exit()

print(total)

import sys

N = int(eval(input()))
b = 1
a = sorted(list(map(int, input().split())), reverse=True)
if a[-1] == 0:
    print("0")
    sys.exit()
for i in a:
    b *= i
    if b > pow(10, 18):
        print("-1")
        sys.exit()
print(b)

import sys

N = int(eval(input()))
a = list(map(str, input().split()))
total = 1
if "0" in a:
    print("0")
    sys.exit()
for i in a:
    total *= int(i)
    if total > 10**18:
        print("-1")
        sys.exit()
print(total)

-b = 1 -a = sorted(list(map(int, input().split())), reverse=True) -if a[-1] == 0: +a = list(map(str, input().split())) +total = 1 +if "0" in a: -    b *= i -    if b > pow(10, 18): +    total *= int(i) +    if total > 10**18: -print(b) +print(total)