from sys import stdin

N = int(stdin.readline().rstrip())

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



count =data[0]

data.remove(data[0])



if 0 in data:

    print((0))



else:



    for _ in data:



        if count ==0:

            break

        elif count <= 10**18:

            count *= _



    if count ==0:

        print((0))

    elif count <= 10**18:

        print(count)

    else:

        print((-1))
from sys import stdin

N = int(stdin.readline().rstrip())

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



count =data[0]

data.remove(data[0])



if 0 in data:

    print((0))



else:

    for _ in data:

        if count ==0:

            break

        elif count <= 10**18:

            count *= _



    if count <= 10**18:

        print(count)

    else:

        print((-1))
from sys import stdin

N = int(stdin.readline().rstrip())
data = list(map(int, input().split()))
count = data[0]
data.remove(data[0])
if 0 in data:
    print((0))
else:
    for _ in data:
        if count == 0:
            break
        elif count <= 10**18:
            count *= _
    if count == 0:
        print((0))
    elif count <= 10**18:
        print(count)
    else:
        print((-1))

from sys import stdin

N = int(stdin.readline().rstrip())
data = list(map(int, input().split()))
count = data[0]
data.remove(data[0])
if 0 in data:
    print((0))
else:
    for _ in data:
        if count == 0:
            break
        elif count <= 10**18:
            count *= _
    if count <= 10**18:
        print(count)
    else:
        print((-1))

-    if count == 0: -        print((0)) -    elif count <= 10**18: +    if count <= 10**18: