process.stdin.resume();
process.stdin.setEncoding('utf-8');
 
let inputString = '';
let currentLine = 0;
 
process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});
 
process.stdin.on('end', _ => {
    inputString = inputString.split(/\n/);
    main();    
});
 
function readLine() {
    return inputString[currentLine++];
}

const mod = Math.pow(10, 9) + 7
function main() {
  const s = Number(readLine())
  let maxLength = Math.floor(s / 3)
  let result = 0
  const { fac, finv } = comInit(s)
  for (let l = 1; l <= maxLength; l++) {
    const remain = s - l * 3
    result += com(remain + l - 1, l - 1, fac, finv)
    result %= mod
  }
  console.log(result)
}

function comInit(l) {
  let fac = [1n, 1n]
  let finv = [1n, 1n]
  let inv = [0n, 1n]
  const biMod = BigInt(mod)
  for (let i = 2; i <= l; i++){
    const biI = BigInt(i)
    fac[i] = fac[i - 1] * biI % biMod;
    inv[i] = biMod - inv[biMod % biI] * (biMod / biI) % biMod;
    finv[i] = finv[i - 1] * inv[i] % biMod;
  }
  return { fac, finv }
}

function com(n, k, fac, finv){
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  const biMod = BigInt(mod)
  return Number(fac[n] * (finv[k] * finv[n - k] % biMod) % biMod);
}