N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
result = 1
max = 10 ** 18
for a in A:
    result *= a
    if result > max:
        print(-1)
        break
else:
    print(result)

d48e39ceba6d91379a361e1c7a55e5b05f9e8f09
<mask token>

<mask token>
for a in A:
    result *= a
    if result > max:
        print(-1)
        break
else:
    print(result)

N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
result = 1
max = 10 ** 18
for a in A:
    result *= a
    if result > max:
        print(-1)
        break
else:
    print(result)
