def combi(n,k)
  k=n-k if 2*k > n
  return 1 if k == 0
  ((n-k+1)..n).reduce(&:*)/((1..k).reduce(&:*))
end

S = gets.to_i

max_n = S / 3

ans = 0

r = 10**9 + 7

(1..max_n).each do |n|
  nokori_cnt = S - 3*n
  sikiri_cnt = n - 1
  combi_n = nokori_cnt + sikiri_cnt
  ans += combi(combi_n, sikiri_cnt) % r
end

puts ans % r
