# B - Multiplication 2

def main():

    _, *A = list(map(int, open(0).read().split()))

    if 0 in A:

        print((0))

        return 

    prod = 1

    LIM = 10 ** 18

    for i in A:

        prod *= i

        if prod > LIM:

            print((-1))

            return

    print(prod)





if __name__ == "__main__":

    main()

# B - Multiplication 2

def main():

    _, *A = open(0).read().split()

    if "0" in A:

        print((0))

        return

    prod = 1

    LIM = 10 ** 18

    for i in A:

        prod *= int(i)

        if prod > LIM:

            print((-1))

            return

    print(prod)





if __name__ == "__main__":

    main()

# B - Multiplication 2
def main():
    _, *A = list(map(int, open(0).read().split()))
    if 0 in A:
        print((0))
        return
    prod = 1
    LIM = 10**18
    for i in A:
        prod *= i
        if prod > LIM:
            print((-1))
            return
    print(prod)


if __name__ == "__main__":
    main()

# B - Multiplication 2
def main():
    _, *A = open(0).read().split()
    if "0" in A:
        print((0))
        return
    prod = 1
    LIM = 10**18
    for i in A:
        prod *= int(i)
        if prod > LIM:
            print((-1))
            return
    print(prod)


if __name__ == "__main__":
    main()

-    _, *A = list(map(int, open(0).read().split())) -    if 0 in A: +    _, *A = open(0).read().split() +    if "0" in A: -        prod *= i +        prod *= int(i)