import Data.List g=1000000007 f2::[Int]->[Int] f2 []=[] f2 (x:xs)=(mod x g) : f2 xs f::Int->[Int]->Int f 1 xs=sum(xs) `mod` g f n xs=let xs2=scanl1 (+) xs in f (n-1) (f2 xs2) main = do e<-getLine let n=read e::Int print $ f n [1,1,1,1,1,1,1,1,1,1]