def gs() gets.chomp end
def gi() gets.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end
def ang(n) Array.new(n){gsmi} end
def debug(k,v) puts "#{k}: #{v}" end
def desc(ar) ar.sort!{|x,y|y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+) end

def cal(sub,d)
  ret = 1
  d.times{|i| ret = ret * (sub+i+1)}
  d.times{|i| ret = ret / (1+i)}
  ret
end

$stdin = File.open('input.txt') if File.exist?('input.txt')
mod = 10**9 + 7
s = gi #
sum = 0
s.times do |i| #1
  sub = s-3*(i+1) #1
  break if sub<0
  sum += cal(sub,i)
end

puts sum%mod
