# -*- coding: utf-8 -*-

n = int(eval(input()))

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

res = 1 

if 0 in a:

  res = 0

else:

  a.sort(reverse=True)

  for num in a:

    res *= num

    if res > 10**18:

      res = -1

      break

print(res)
# -*- coding: utf-8 -*-

n = int(eval(input()))

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

res = 1 

if 0 in a:

  res = 0

else:

  for num in a:

    res *= num

    if res > 10**18:

      res = -1

      break

print(res)
# -*- coding: utf-8 -*-
n = int(eval(input()))
a = list(map(int, input().split()))
res = 1
if 0 in a:
    res = 0
else:
    a.sort(reverse=True)
    for num in a:
        res *= num
        if res > 10**18:
            res = -1
            break
print(res)

# -*- coding: utf-8 -*-
n = int(eval(input()))
a = list(map(int, input().split()))
res = 1
if 0 in a:
    res = 0
else:
    for num in a:
        res *= num
        if res > 10**18:
            res = -1
            break
print(res)

-    a.sort(reverse=True)