import sys

n=int(eval(input()))

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

List.sort(reverse=True)

if List[-1]==0:

    print((0))

    sys.exit()

ans=1

for i in List:

    if ans<=10**18:

        ans*=i

    else:

        print((-1))

        sys.exit()

if ans<=10**18:

    print(ans)

else:

    print((-1))
n=int(eval(input()))

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

ans=1

a.sort(reverse=True)

if a[-1]==0:

    print((0))

    exit()

for i in range(len(a)):

    ans*=a[i]

    if ans>1000000000000000000:

        ans=-1

        break

print(ans)
import sys

n = int(eval(input()))
List = list(map(int, input().split()))
List.sort(reverse=True)
if List[-1] == 0:
    print((0))
    sys.exit()
ans = 1
for i in List:
    if ans <= 10**18:
        ans *= i
    else:
        print((-1))
        sys.exit()
if ans <= 10**18:
    print(ans)
else:
    print((-1))

n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
a.sort(reverse=True)
if a[-1] == 0:
    print((0))
    exit()
for i in range(len(a)):
    ans *= a[i]
    if ans > 1000000000000000000:
        ans = -1
        break
print(ans)

-import sys - -List = list(map(int, input().split())) -List.sort(reverse=True) -if List[-1] == 0: +a = list(map(int, input().split())) +ans = 1 +a.sort(reverse=True) +if a[-1] == 0: -    sys.exit() -ans = 1 -for i in List: -    if ans <= 10**18: -        ans *= i -    else: -        print((-1)) -        sys.exit() -if ans <= 10**18: -    print(ans) -else: -    print((-1)) +    exit() +for i in range(len(a)): +    ans *= a[i] +    if ans > 1000000000000000000: +        ans = -1 +        break +print(ans)