require 'pp'

# f = Fcational.new(max, MOD)
# f.at(10) #=> 10! (mod MOD)
# f.inv(10) #=> (10!)^(-1) (mod MOD)

class Fractional
    attr_reader :mod

    def initialize(max, mod)
        @max = max
        @mod = mod
        @frac     = { 0 => 1, 1 => 1 }
        @frac_inv = { 0 => 1, 1 => 1 }
        @inv      = {         1 => 1 }

        pre_calc(max)
    end

    def pre_calc(max)
        2.upto(max) do |i|
            @frac[i] = @frac[i - 1] * i % @mod;
            @inv[i] = @mod - @inv[@mod % i] * (@mod / i) % @mod
            @frac_inv[i] = @frac_inv[i - 1] * @inv[i] % @mod
        end
    end

    def at(i)
        @frac[i]
    end

    def inv_at(i)
        @frac_inv[i]
    end
end

# precalc_fraciotnalを使う前提
# f = Fcational.new(max, mod)
# c = Combination.new(f)
# c.calc(n, r)

class Combination
    def initialize(fraction)
        @fraction = fraction
    end

    def calc(n, r)
        return 0 if n < r
        return 0 if (n < 0 || r < 0)

        denom_inv = (@fraction.inv_at(r) * @fraction.inv_at(n - r) % @fraction.mod)
        return @fraction.at(n) * denom_inv % @fraction.mod
    end
end

MOD = 10 ** 9 + 7
s = gets.to_i

if s < 3
    puts 0
    exit 0
end

f = Fractional.new(10000, MOD)
c = Combination.new(f)

# 最高で軟膏つかえるか
x = s / 3
sum = 1 # i = 1は必ず1個

2.upto(x) do |i|
    t = s - i * 3
    #pp t
    # iHt = (t+i-1)Ct
    #pp c.calc(t+i-1, t)
    sum = (sum + c.calc(t+i-1, t)) % MOD
end

puts sum
