from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n = inp()

a = inpl()

a.sort()

x = 1

for i in range(n):

    x *= a[i]

    # print(i,x)

    if x > 10**18:

        print((-1))

        quit()

print(x)
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n = inp()

a = inpl()

if 0 in set(a):

    print((0))

    quit()

res = 1

for x in a:

    res *= x

    if res > 10**18:

        print((-1))

        quit()

print(res)
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n = inp()
a = inpl()
a.sort()
x = 1
for i in range(n):
    x *= a[i]
    # print(i,x)
    if x > 10**18:
        print((-1))
        quit()
print(x)

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n = inp()
a = inpl()
if 0 in set(a):
    print((0))
    quit()
res = 1
for x in a:
    res *= x
    if res > 10**18:
        print((-1))
        quit()
print(res)

-from heapq import heappop, heappush, heapify +from heapq import heappop, heappush -import sys, math, itertools, fractions, pprint +import sys, math, itertools, fractions -a.sort() -x = 1 -for i in range(n): -    x *= a[i] -    # print(i,x) -    if x > 10**18: +if 0 in set(a): +    print((0)) +    quit() +res = 1 +for x in a: +    res *= x +    if res > 10**18: -print(x) +print(res)