read
read aa
a=($aa)
for b in ${a[@]};do
 if [ $b -eq 0 ];then
  echo 0
  exit
 fi
done
c=1
LIM=$[10**18]
for b in ${a[@]};do
 if [ $b -gt $[LIM/c] ];then
  echo -1
  exit
 fi
 c=$[c*b]
done
if [ $c -gt $LIM ];then
 echo -1
else
 echo $c
fi