read n n++/2%m+1 echo $[m=1000007,(_*_-1)%m]