mod' a = a `mod` (10^6+7) main = readLn >>= print . mod' . soroban . mod' where soroban :: Integer -> Integer soroban x = s1 + s2 where s1 = y1 * (y2 + 1) s2 = y2 y1 = x - y2 y2 = (x `div` 2) + 1