import kotlin.math.*

fun str() = readLine()!!
fun int() = str().toInt()
fun long() = str().toLong()

fun read(d: String = " ") = str().split(d)
fun <T> list(d: String = " ", f: String.() -> T) = read(d).map { f(it) }
fun list() = list { toInt() }

fun <T> MutableList<T>.removeLast() = this.removeAt(this.lastIndex)

const val mod = 1000000007L

fun modpow(n: Long, p: Long = mod - 2L): Long = when {
    p == 0L -> 1L
    p % 2 == 1L -> n * modpow(n, p - 1) % mod
    else -> {
        val d = modpow(n, p / 2)
        d * d % mod
    }
}

fun nCr(n: Long, r: Long): Long = ((n - r + 1L..n).asSequence() + (2L..r).asSequence().map { modpow(it) }).fold(1L) { a, b -> a * b % mod }

fun main() {
    abc000X()
}

fun abc000X() {
    val n = long()
    var r = 0L
    for (i in 1..n / 3) {
        //System.err.println(n - 3 * i to i - 1 to nCr(n - 3 * i, i - 1))
        r = (r + nCr(n + i - 1 - 3 * i, i - 1)) % mod
    }
    println(r)
}
