S = gets.to_i
M = 10**9 + 7

@fac, @inv, @fiv = [1, 1], [1, 1], [1, 1]
(2 .. S).each do |i|
  @fac[i] = @fac[i - 1] * i % M
  @inv[i] = M - @inv[M % i] * (M / i) % M
  @fiv[i] = @fiv[i - 1] * @inv[i] % M
end
c = ->(a, b){a < b ? 0 : @fac[a]*@fiv[b]*@fiv[a - b] % M}
puts (1 .. S/3).inject(0){|s, n| (s + c[S - 3*n + n - 1, n - 1]) % M}