n = int(eval(input()))

l = [int(item) for item in input().split()]

l.sort()

product = 1

flag=0

for i in l:

	product *= i

	if product > int(10**18):

		print("-1")

		flag=1

		break

 

if flag == 0:

	print(product)
#!/usr/bin/env python3

import sys





def solve(N: int, A: "List[int]"):

    if(0 in A):

        print((0))

        sys.exit()



    sum_l = 1

    for x in A:

        sum_l *= x

        if(sum_l > 10 **18):

            print((-1))

            sys.exit()



    print(sum_l)

    return





# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)

def main():

    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    N = int(next(tokens))  # type: int

    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"

    solve(N, A)



if __name__ == '__main__':

    main()

n = int(eval(input()))
l = [int(item) for item in input().split()]
l.sort()
product = 1
flag = 0
for i in l:
    product *= i
    if product > int(10**18):
        print("-1")
        flag = 1
        break
if flag == 0:
    print(product)

#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    if 0 in A:
        print((0))
        sys.exit()
    sum_l = 1
    for x in A:
        sum_l *= x
        if sum_l > 10**18:
            print((-1))
            sys.exit()
    print(sum_l)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == "__main__":
    main()

-n = int(eval(input())) -l = [int(item) for item in input().split()] -l.sort() -product = 1 -flag = 0 -for i in l: -    product *= i -    if product > int(10**18): -        print("-1") -        flag = 1 -        break -if flag == 0: -    print(product) +#!/usr/bin/env python3 +import sys + + +def solve(N: int, A: "List[int]"): +    if 0 in A: +        print((0)) +        sys.exit() +    sum_l = 1 +    for x in A: +        sum_l *= x +        if sum_l > 10**18: +            print((-1)) +            sys.exit() +    print(sum_l) +    return + + +# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template) +def main(): +    def iterate_tokens(): +        for line in sys.stdin: +            for word in line.split(): +                yield word + +    tokens = iterate_tokens() +    N = int(next(tokens))  # type: int +    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]" +    solve(N, A) + + +if __name__ == "__main__": +    main()