# coding: utf-8

a = int(eval(input()))

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

c = 1

if 0 in b:

    print((0))

else:

  while c < 10 ** 18 and len(b) != 0:

    c = c * b[0]

    del b[0]

  if c > 10 ** 18:

    print((-1))

  else:

    print(c)
import sys



num = int(eval(input()))

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

b = 1

if 0 in a:

    print((0))

    sys.exit()

for i in a:

  if b * i > 10 ** 18:

    print((-1))

    sys.exit()

  else:

    b *= i

print(b)
# coding: utf-8
a = int(eval(input()))
b = list(map(int, input().split()))
c = 1
if 0 in b:
    print((0))
else:
    while c < 10**18 and len(b) != 0:
        c = c * b[0]
        del b[0]
    if c > 10**18:
        print((-1))
    else:
        print(c)

import sys

num = int(eval(input()))
a = list(map(int, input().split()))
b = 1
if 0 in a:
    print((0))
    sys.exit()
for i in a:
    if b * i > 10**18:
        print((-1))
        sys.exit()
    else:
        b *= i
print(b)

-# coding: utf-8 -a = int(eval(input())) -b = list(map(int, input().split())) -c = 1 -if 0 in b: +import sys + +num = int(eval(input())) +a = list(map(int, input().split())) +b = 1 +if 0 in a: -else: -    while c < 10**18 and len(b) != 0: -        c = c * b[0] -        del b[0] -    if c > 10**18: +    sys.exit() +for i in a: +    if b * i > 10**18: +        sys.exit() -        print(c) +        b *= i +print(b)