import sys



n = int(eval(input()))

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

a.sort()



if 0 in a:

    print((0))

else:

    cur = 1

    for x in a:

        cur *= x

        if cur > 10 ** 18:

            print((-1))

            sys.exit()

    print(cur)

import sys



n = int(eval(input()))

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



if 0 in a_list:

    print((0))

    sys.exit()

else:

    cul = 1

    for a in a_list:

        cul *= a

        if cul > 10 ** 18:

            print((-1))

            sys.exit()

    print(cul)

import sys

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

import sys

n = int(eval(input()))
a_list = list(map(int, input().split()))
if 0 in a_list:
    print((0))
    sys.exit()
else:
    cul = 1
    for a in a_list:
        cul *= a
        if cul > 10**18:
            print((-1))
            sys.exit()
    print(cul)

-a = list(map(int, input().split())) -a.sort() -if 0 in a: +a_list = list(map(int, input().split())) +if 0 in a_list: +    sys.exit() -    cur = 1 -    for x in a: -        cur *= x -        if cur > 10**18: +    cul = 1 +    for a in a_list: +        cul *= a +        if cul > 10**18: -    print(cur) +    print(cul)