import math
from functools import reduce


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

maxi = math.pow(10,18)
mult = reduce(lambda x,y: x*y, A)
    
if mult > maxi:
    print("-1")
else:
    print(mult)