<>=~$";$_[$%=$_]||map++$_[$_*$%],1..$`/$%for 2..$`;print~~grep$_>=$',@_