import sys

readline = sys.stdin.buffer.readline

n = int(readline())

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

a.sort()

v = 1

for i in a:

  v *= i

  if v > 1000000000000000000:

    print((-1))

    break

  elif v == 0:

    print((0))

    break

else:

  print(v)
import sys

readline = sys.stdin.buffer.readline

n = int(readline())

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

v = 1



if min(a) == 0:

  print((0))

else:

  for i in a:

    v *= i

    if v > 1000000000000000000:

      print((-1))

      break

  else:

    print(v)
import sys

readline = sys.stdin.buffer.readline
n = int(readline())
a = list(map(int, readline().split()))
a.sort()
v = 1
for i in a:
    v *= i
    if v > 1000000000000000000:
        print((-1))
        break
    elif v == 0:
        print((0))
        break
else:
    print(v)

import sys

readline = sys.stdin.buffer.readline
n = int(readline())
a = list(map(int, readline().split()))
v = 1
if min(a) == 0:
    print((0))
else:
    for i in a:
        v *= i
        if v > 1000000000000000000:
            print((-1))
            break
    else:
        print(v)

-a.sort() -for i in a: -    v *= i -    if v > 1000000000000000000: -        print((-1)) -        break -    elif v == 0: -        print((0)) -        break +if min(a) == 0: +    print((0)) -    print(v) +    for i in a: +        v *= i +        if v > 1000000000000000000: +            print((-1)) +            break +    else: +        print(v)