MOD = 10**9 + 7
s = gets.to_i

fac = [1, 1]
finv = [1, 1]
inv = [nil, 1]
(2..s).each do |i|
  fac[i] = fac[i-1] * i % MOD
  inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD
  finv[i] = finv[i-1] * inv[i] % MOD
end

com = ->(n, k) { fac[n] * finv[n - k] % MOD * finv[k] % MOD }

p (1..s/3).sum { |n| com.(s - 2 * n - 1, n - 1) } % MOD