class Combinator
  MAX = 2200 # nCkの最大のnより大きいこと。MODより小さいこと。
  MOD = 1000000007

  def initialize
    @fac = Array.new(MAX)
    @fac[0] = 1
    @fac[1] = 1
    @finv = Array.new(MAX)
    @finv[0] = 1
    @finv[1] = 1
    @inv = Array.new(MAX)
    @inv[1] = 1
    (2..(MAX-1)).each do |i|
      @fac[i] = @fac[i-1]*i%MOD
      @inv[i] = MOD-@inv[MOD%i]*(MOD/i)%MOD
      @finv[i] = @finv[i-1]*@inv[i]%MOD
    end
  end

  def call(all, select)
    return 0 if all < select
    return 0 if all < 0||select < 0
    @fac[all]*(@finv[select]*@finv[all-select]%MOD)%MOD
  end
end
@combinator = Combinator.new

s = gets.to_i
if s < 3
  puts 0
  exit 0
elsif s == 3
  puts 1
  exit 0
end

max_len = s / 3
sum = 1
(2..max_len).each do |len|
  d = s - len * 3
  # d を len 個のどこに配分するかのパターン数 = len個から重複ありでd個選ぶ組み合わせの数
  sum += @combinator.call(len+d-1, d)
  sum %= 1000000007
end
puts sum