To store the factorial and factorial mod inverse of the numbers
let factorial = new Array ( 1000005 ) ; let modinverse = new Array ( 1000005 ) ; factorial . fill ( 0 ) ; modinverse . fill ( 0 ) ; let mod = 1000000007 ; let N = 1000005 ;