def modpow(a, n, m)
  return 1 if n == 0

  tmp = modpow(a, n / 2, m)
  n % 2 == 0 ? tmp * tmp % m : tmp * tmp * a % m
end

def modinv(a, m)
  modpow(a, m - 2, m)
end

s = gets.chomp.to_i
M = (1e9+7).to_i

fa = (1..s).inject([1]) { |acc, i| acc << acc[-1] * i % M; acc }
fi = fa.map { |f| modinv(f, M) }

puts (1..(s / 3)).inject(0) { |acc, i| (acc + fa[s - 1 - 2 * i] * fi[i - 1] * fi[s - 3 * i]) % M }