def main():

  N = int(eval(input()))

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

  if 0 in A:

    print((0))

    return

  prd = 1

  for a in A:

    prd *= a

    if prd > 1000000000000000000:

      print((-1))

      return

  print(prd)



main()
N = int(eval(input()))

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

X = 10**18

ans = 1

if 0 in A:

  ans = 0

else:

  for i in range(N):

    ans = ans * A[i]

    if ans > X:

      ans = -1

      break

print(ans)
def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    if 0 in A:
        print((0))
        return
    prd = 1
    for a in A:
        prd *= a
        if prd > 1000000000000000000:
            print((-1))
            return
    print(prd)


main()

N = int(eval(input()))
A = list(map(int, input().split()))
X = 10**18
ans = 1
if 0 in A:
    ans = 0
else:
    for i in range(N):
        ans = ans * A[i]
        if ans > X:
            ans = -1
            break
print(ans)

-def main(): -    N = int(eval(input())) -    A = list(map(int, input().split())) -    if 0 in A: -        print((0)) -        return -    prd = 1 -    for a in A: -        prd *= a -        if prd > 1000000000000000000: -            print((-1)) -            return -    print(prd) - - -main() +N = int(eval(input())) +A = list(map(int, input().split())) +X = 10**18 +ans = 1 +if 0 in A: +    ans = 0 +else: +    for i in range(N): +        ans = ans * A[i] +        if ans > X: +            ans = -1 +            break +print(ans)