n = gets.to_i
MOD = 10**9+7
#前処理 O(n)
$fact,$fact_inv,$inv = Array.new(n+1),Array.new(n+1),Array.new(n+1)
$fact[0] = $fact[1] = 1
$fact_inv[0] = $fact_inv[1] = 1
$inv[1] = 1
for i in 2..n
  $fact[i] = $fact[i-1] * i % MOD
  $inv[i] = MOD - $inv[MOD % i]*(MOD/i) % MOD
  $fact_inv[i] = $fact_inv[i-1] * $inv[i] % MOD
end
#クエリ O(1)
def nCkMOD(n,k)
  $fact[n]*($fact_inv[k]*$fact_inv[n-k] % MOD) % MOD
end


ans = 0
for j in 1..(n/3)
  ans += (nCkMOD(n-2*j-1,j-1))
  ans %= MOD
end
puts ans