# https://atcoder.jp/contests/abc169/submissions/13893064



def main():

    from itertools import zip_longest



    LIMIT = 10 ** 18



    N = int(eval(input()))

    *A, = list(map(int, input().split()))



    while len(A) > 1:

        A = [x * y for x, y in zip_longest(A[::2], A[1::2], fillvalue=1)]



    if A[0] > LIMIT:

        print((-1))

    else:

        print((A[0]))





if __name__ == '__main__':

    main()

def main():

    N = int(eval(input()))

    *A, = list(map(int, input().split()))



    if 0 in A:

        print((0))

        return



    t = 1

    for x in A:

        t *= x

        if t > 10 ** 18:

            print((-1))

            return

    print(t)





if __name__ == '__main__':

    main()

# https://atcoder.jp/contests/abc169/submissions/13893064
def main():
    from itertools import zip_longest

    LIMIT = 10**18
    N = int(eval(input()))
    (*A,) = list(map(int, input().split()))
    while len(A) > 1:
        A = [x * y for x, y in zip_longest(A[::2], A[1::2], fillvalue=1)]
    if A[0] > LIMIT:
        print((-1))
    else:
        print((A[0]))


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    (*A,) = list(map(int, input().split()))
    if 0 in A:
        print((0))
        return
    t = 1
    for x in A:
        t *= x
        if t > 10**18:
            print((-1))
            return
    print(t)


if __name__ == "__main__":
    main()

-# https://atcoder.jp/contests/abc169/submissions/13893064 -    from itertools import zip_longest - -    LIMIT = 10**18 -    while len(A) > 1: -        A = [x * y for x, y in zip_longest(A[::2], A[1::2], fillvalue=1)] -    if A[0] > LIMIT: -        print((-1)) -    else: -        print((A[0])) +    if 0 in A: +        print((0)) +        return +    t = 1 +    for x in A: +        t *= x +        if t > 10**18: +            print((-1)) +            return +    print(t)