"""

~~ Author : Bhaskar

~~ Dated : 31~05~2020

"""



import sys

from bisect import *

from math import floor,sqrt,ceil,factorial as F,gcd,pi

from itertools import chain,combinations,permutations,accumulate

from collections import Counter,defaultdict,OrderedDict,deque

from array import array

INT_MAX = sys.maxsize

INT_MIN = -(sys.maxsize)-1

mod = 10**18

lcm = lambda a,b : (a*b)//gcd(a,b)

setbit = lambda x : bin(x)[2:].count("1")



def solve():

    n = int(sys.stdin.readline())

    a = list(map(int,sys.stdin.readline().split()))

    ans =  1

    flag = False

    for i in a:

        ans *= i

        # print(ans)

        if ans > mod:

            flag = True

            break

    if 0 in a:

        print((0))

    else:

        if not flag:

            print(ans)

        else:

            print((-1))



if __name__ == "__main__":

    solve()

"""

~~ Author : Bhaskar

~~ Dated : 13~06~2020

"""



import sys

from bisect import *

from math import floor, sqrt, ceil, factorial as F, gcd, pi

from itertools import chain, combinations, permutations, accumulate

from collections import Counter, defaultdict, OrderedDict, deque



INT_MAX = sys.maxsize

INT_MIN = -(sys.maxsize) - 1

mod = 1000000007

ch = "abcdefghijklmnopqrstuvwxyz"

lcm = lambda a, b: (a * b) // gcd(a, b)

setbit = lambda x: bin(x)[2:].count("1")

INT = lambda type: type(sys.stdin.readline()) if type in [int, float] else type(sys.stdin.readline()).replace("\n", "")

ARRAY = lambda type: list(map(type, sys.stdin.readline().split()))

NUMS = lambda type: list(map(type, sys.stdin.readline().split()))





def solve():



    n = INT(int)

    a = ARRAY(int)

    if 0 in a:

        print((0))

    else:

        p = 1

        ok = False

        for i in a:

            p *= i

            if p > 10**18:

                ok = True

                break

        print((p if not ok else -1))







if __name__ == "__main__":

    # try:

    #     sys.stdin = open("input.txt", "r")

    # except:

    #     pass

    solve()

"""
~~ Author : Bhaskar
~~ Dated : 31~05~2020
"""
import sys
from bisect import *
from math import floor, sqrt, ceil, factorial as F, gcd, pi
from itertools import chain, combinations, permutations, accumulate
from collections import Counter, defaultdict, OrderedDict, deque
from array import array

INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize) - 1
mod = 10**18
lcm = lambda a, b: (a * b) // gcd(a, b)
setbit = lambda x: bin(x)[2:].count("1")


def solve():
    n = int(sys.stdin.readline())
    a = list(map(int, sys.stdin.readline().split()))
    ans = 1
    flag = False
    for i in a:
        ans *= i
        # print(ans)
        if ans > mod:
            flag = True
            break
    if 0 in a:
        print((0))
    else:
        if not flag:
            print(ans)
        else:
            print((-1))


if __name__ == "__main__":
    solve()

"""
~~ Author : Bhaskar
~~ Dated : 13~06~2020
"""
import sys
from bisect import *
from math import floor, sqrt, ceil, factorial as F, gcd, pi
from itertools import chain, combinations, permutations, accumulate
from collections import Counter, defaultdict, OrderedDict, deque

INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize) - 1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a, b: (a * b) // gcd(a, b)
setbit = lambda x: bin(x)[2:].count("1")
INT = (
    lambda type: type(sys.stdin.readline())
    if type in [int, float]
    else type(sys.stdin.readline()).replace("\n", "")
)
ARRAY = lambda type: list(map(type, sys.stdin.readline().split()))
NUMS = lambda type: list(map(type, sys.stdin.readline().split()))


def solve():
    n = INT(int)
    a = ARRAY(int)
    if 0 in a:
        print((0))
    else:
        p = 1
        ok = False
        for i in a:
            p *= i
            if p > 10**18:
                ok = True
                break
        print((p if not ok else -1))


if __name__ == "__main__":
    # try:
    #     sys.stdin = open("input.txt", "r")
    # except:
    #     pass
    solve()

-~~ Dated : 31~05~2020 +~~ Dated : 13~06~2020 -from array import array -mod = 10**18 +mod = 1000000007 +ch = "abcdefghijklmnopqrstuvwxyz" +INT = ( +    lambda type: type(sys.stdin.readline()) +    if type in [int, float] +    else type(sys.stdin.readline()).replace("\n", "") +) +ARRAY = lambda type: list(map(type, sys.stdin.readline().split())) +NUMS = lambda type: list(map(type, sys.stdin.readline().split())) -    n = int(sys.stdin.readline()) -    a = list(map(int, sys.stdin.readline().split())) -    ans = 1 -    flag = False -    for i in a: -        ans *= i -        # print(ans) -        if ans > mod: -            flag = True -            break +    n = INT(int) +    a = ARRAY(int) -        if not flag: -            print(ans) -        else: -            print((-1)) +        p = 1 +        ok = False +        for i in a: +            p *= i +            if p > 10**18: +                ok = True +                break +        print((p if not ok else -1)) +    # try: +    #     sys.stdin = open("input.txt", "r") +    # except: +    #     pass