def comb(n,m)
  new_m = [m,n-m].min
  ret = 1
  for i in n-new_m+1..n
    ret *= i
  end
  for i in 1..new_m
    ret /= i
  end
  return ret
end

n = gets.to_i
mod = 10**9 + 7
a = n / 3
b = n % 3
ans = 0
for box in 1..a
  amari = n - 3 * box
  ans += comb(amari+box-1,amari)
  ans %= mod
end

puts ans