import java.io.PrintStream
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`);
    try {
        solve(sc, System.out);
    } finally {
        sc.close();
    }
}

fun solve(sc: Scanner, wr: PrintStream) {
    val MOD = 1e9.toLong() + 7
    val S = sc.nextInt()

    val dp = Array(S + 1) {0L }
    dp[0] = 1
    for (i in 0..S) {
        for (j in 3..S) {
            if (i + j > S) break

            dp[i + j] += dp[i]
            dp[i + j] %= MOD
        }
    }

    wr.println(dp[S])
}
