n = gets.to_i

m = n / 3
b = n % 3

sum = 0
m.times do |i|
  mm = m - i
  bb = b + 3 * i
  ci = bb + mm - 1
  cj = [bb, ci - bb].min
  add = 1
  if cj > 0
    cc = ((ci-cj+1)..ci).reduce(&:*)
    cp = ((1..cj).reduce(&:*))
    add = cc / cp
  end

  sum += add
  sum %= 10 ** 9 + 7
end

puts sum