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

def inverse(a)
  pows = [1,]
  for i in 1..35 do
    if i == 1 then
      pows[i] = a
    else
      pows[i] = (pows[i-1] ** 2) % Mod
    end
  end
  result = 1
  for i in 1..35 do
    if (Mod-2)[i-1] == 1 then
      result = (result * pows[i]) % Mod
    end
  end
  return(result)
end
  
kai = [1,1]      # 0!, 1!
for i in 2..10000 do      # kai[n] = n!
  kai[i] = (kai[i-1] * i) % Mod
end
  
len_max = S / 3

ans = 0
for i in 1..len_max do
  ans = (ans + kai[S-2*i-1] * inverse(kai[i-1]) * inverse(kai[S-3*i])) % Mod
end
puts ans