Modulo inverse

How to calculate

(( a^(n) - 1 )/(a-1) )%(1e9+7)
Please help anyone !

@prajjwalhacker see this

or
this one