MOD = 10 ** 9 + 7

s = $stdin.readline.to_i
res = 0
inv = Array.new(s + 1)
s.times do |i|
  if i == 0
    inv[i + 1] = 1
  else
    inv[i + 1] = (- inv[MOD % (i + 1)] * (MOD / (i + 1))) % MOD
  end
end

(s / 3).times do |t|
  if t == 0
    res += 1
    next
  end
  t += 1

  comb = Array.new(t)
  comb[0] = 1
  
  (t - 1).times do |i|
    comb[i + 1] = comb[i] * (s - 2 * t - 1 - i) * inv[i + 1] % MOD
  end

  res = (res + comb[t - 1]) % MOD
end
puts res