main :: IO () main = print . solve =<< readLn solve :: Int -> Int solve n = solve' 1 n (1, 0, 0) where solve' :: Int -> Int -> (Int, Int, Int) -> Int solve' i n (a, aa, ab) | i == n = (a + aa + ab) `rem` (10 ^ 9 + 7) | otherwise = solve' (i + 1) n (ab, a, a + aa)