func _ (-1) _ =((1,0,0),(0,0,0)) func r 0 b=(r,b) func (a,b,c) n _=func (c,a+c,b) (n-1) (a,b,c) sum_ (a,b,c) =a+b+c main = do n<-fmap read getLine::IO Int let (f,b)=func (0,1,0) (n-2) (1,0,0) print$(sum_ f + sum_ b) `mod` 1000000007