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

if 0 in l:
    r=0
else:
    r = 1
    for x in range(n):
        r = r * l[x]
        if r > 10**18:
            r=-1
            break
  
print(r)