
import scala.io.StdIn

object Main extends App {
  val s = StdIn.readInt()
  def factorial(n: Int):BigInt = List.range(1, n+1).map(BigInt(_)).foldLeft(BigInt(1))(_*_)
  def factorialPart(from:Int,to:Int):BigInt = List.range(from, to+1).map(BigInt(_)).foldLeft(BigInt(1))(_*_)
  var sum = BigInt(0)
  var seqLength = 1
  while(3*seqLength <= s){
    val retNum = s - 3*seqLength
    sum += factorialPart(retNum+1,retNum + (seqLength -1))/factorial(seqLength -1)
    //println(s"${seqLength}:${factorialPart(retNum+1,retNum + (seqLength -1))},${factorial(seqLength -1)}")
    seqLength += 1
  }

  val mod = BigInt(10).pow(9) + 7
  println(sum % mod)
}





