from math import log10

n = int(input())
a = [int(x) for x in input().split(' ')]

sum = 1



for i in range(n):
    sum *= a[i];

if sum != 0 and (sum - 10**18) > 0:
    print(-1)
else:
    print(sum)