def main():

    n = int(eval(input()))

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

    MAX = 10**18

    if 0 in set(a):

        print((0))

    else:

        ans = a[0]

        for ai in a[1:]:

            ans *= ai

            if ans > MAX:

                print((-1))

                return

        print(ans)



if __name__ == "__main__":

    main()
def main():

    n = int(eval(input()))

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

    if 0 in a:

        print((0))

        exit(0)

    ans = 1

    MAX = 10**18

    for ai in a:

        ans *= ai

        if ans > MAX:

            print((-1))

            exit(0)

    print(ans)



if __name__ == "__main__":

    main()
def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    MAX = 10**18
    if 0 in set(a):
        print((0))
    else:
        ans = a[0]
        for ai in a[1:]:
            ans *= ai
            if ans > MAX:
                print((-1))
                return
        print(ans)


if __name__ == "__main__":
    main()

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    if 0 in a:
        print((0))
        exit(0)
    ans = 1
    MAX = 10**18
    for ai in a:
        ans *= ai
        if ans > MAX:
            print((-1))
            exit(0)
    print(ans)


if __name__ == "__main__":
    main()

+    if 0 in a: +        print((0)) +        exit(0) +    ans = 1 -    if 0 in set(a): -        print((0)) -    else: -        ans = a[0] -        for ai in a[1:]: -            ans *= ai -            if ans > MAX: -                print((-1)) -                return -        print(ans) +    for ai in a: +        ans *= ai +        if ans > MAX: +            print((-1)) +            exit(0) +    print(ans)