fun main() {
  val MOD = 1000000007
  val S = readInt()

  val dp = Array(S + 1) { 0 }
  for (i in 3..S) {
    var sum = 0
    for (j in 0..(i - 3)) sum = (sum + dp[j]) % MOD
    dp[i] = sum + 1
  }
  println(dp[S])
}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readLong() = readString().toLong()
fun readInts() = readStrings().map { it.toInt() }
fun readLongs() = readStrings().map { it.toLong() }
