<>; $a+=$_>50,$b+=$_!=50for glob<>; $z=1; $z=$z*2%(1e9+7)for 2..$b; print$a&&$z;