map{$\=$\*$_%(1e9+7)for($p&$_)eq$p..y/1//-$p=~y/1//;$p=$_}sort map{sprintf'%060b',$_}(++$\<<<>)-1,glob<>;print