let S =
    stdin.ReadLine()
    |> int
let Mod = 1000000007L

let rec culcPow value pow i =
    if i=0L then value
    else
        let newPow = (pow * pow) % Mod
        let newI = i >>> 1
        if i%2L=1L then culcPow ((value*pow)%Mod) newPow newI
        else culcPow value newPow newI

let Factorial = Array.scan (fun state item -> state * item % Mod) 1L [|1L..int64(S)|]

let conv n k = Factorial.[n] * (culcPow 1L (Factorial.[k]) (Mod-2L)) % Mod * (culcPow 1L (Factorial.[n-k]) (Mod-2L)) % Mod

[|1..S/3|]
|> Array.map (fun k -> conv (S-k*2-1) (k-1))
|> Array.fold (fun state item -> (state+item)%Mod) 0L
|> stdout.WriteLine