s = gets.to_i
M = 1_000_000_007

fac = Array.new(s, 1)
(s-1).times {|i| fac[i+1] = fac[i] * (i+1) % M}
inv_fac = Array.new(s)
inv_fac[-1] = fac[-1].pow(M - 2, M)
(s - 2).downto(0) {|i| inv_fac[i] = inv_fac[i+1] * (i+1) % M}

com =->(a, b){fac[a] * inv_fac[b] * inv_fac[a-b] % M}

ans = 0
(1..).each do |i|
    break if 3 * i > s
    x = s - 3 * i
    ans = (ans + com.(x + i - 1, i - 1)) % M
end

p ans