import sys

N=int(eval(input()))

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

alist.sort()



if alist[0]==0:

  print((0))

  sys.exit(0)



answer=1

e18=10**18

for a in alist:

  answer*=a

  if answer>e18:

    print((-1))

    break

else:

  print(answer)
import sys

N=int(eval(input()))

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



if 0 in alist:

  print((0))

  sys.exit(0)



answer=1

e18=10**18

for a in alist:

  answer*=a

  if answer>e18:

    print((-1))

    break

else:

  print(answer)
import sys

N = int(eval(input()))
alist = list(map(int, input().split()))
alist.sort()
if alist[0] == 0:
    print((0))
    sys.exit(0)
answer = 1
e18 = 10**18
for a in alist:
    answer *= a
    if answer > e18:
        print((-1))
        break
else:
    print(answer)

import sys

N = int(eval(input()))
alist = list(map(int, input().split()))
if 0 in alist:
    print((0))
    sys.exit(0)
answer = 1
e18 = 10**18
for a in alist:
    answer *= a
    if answer > e18:
        print((-1))
        break
else:
    print(answer)

-alist.sort() -if alist[0] == 0: +if 0 in alist: