from functools import reduce

from operator import mul

import math



def main():

    n = int(eval(input()))

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



    if 0 in l:

        print((0))

        return

    l_sorted = sorted(l, reverse=True)

    log = 0

    seki = 1

    for i in l_sorted:

        log += math.log10(i)

        if log > 18:

            print((-1))

            return

        elif log == 18:

            seki *= i

            if seki != 10 ** 18:

                print((-1))

                return

        else:

            seki *= i

    print(seki)

    return





if __name__ == '__main__':

    main()
def main():

    n = int(eval(input()))

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



    if 0 in l:

        print((0))

        return



    prod = 1

    for i in l:

        prod *= i

        if prod > 1000000000000000000:

            print((-1))

            return



    print(prod)



if __name__ == '__main__':

    main()
from functools import reduce
from operator import mul
import math


def main():
    n = int(eval(input()))
    l = list(map(int, input().split()))
    if 0 in l:
        print((0))
        return
    l_sorted = sorted(l, reverse=True)
    log = 0
    seki = 1
    for i in l_sorted:
        log += math.log10(i)
        if log > 18:
            print((-1))
            return
        elif log == 18:
            seki *= i
            if seki != 10**18:
                print((-1))
                return
        else:
            seki *= i
    print(seki)
    return


if __name__ == "__main__":
    main()

def main():
    n = int(eval(input()))
    l = list(map(int, input().split()))
    if 0 in l:
        print((0))
        return
    prod = 1
    for i in l:
        prod *= i
        if prod > 1000000000000000000:
            print((-1))
            return
    print(prod)


if __name__ == "__main__":
    main()

-from functools import reduce -from operator import mul -import math - - -    l_sorted = sorted(l, reverse=True) -    log = 0 -    seki = 1 -    for i in l_sorted: -        log += math.log10(i) -        if log > 18: +    prod = 1 +    for i in l: +        prod *= i +        if prod > 1000000000000000000: -        elif log == 18: -            seki *= i -            if seki != 10**18: -                print((-1)) -                return -        else: -            seki *= i -    print(seki) -    return +    print(prod)