MOD = 1_000_000_007

def memoize(name)
  original = "__original_#{name}__"
  self.class.class_eval {
    alias_method(original, name)
    private(original)
    cache = {}
    define_method(name){|*args|
      cache[args] ||= send(original, *args)
    }
  }
end 

def f(n, k)
  return 1 if n == 0
  return 0 if n < 0
  return 0 if k == 0
  (f(n, k-1) + f(n-k, k)) % MOD
end

memoize :f

n0, k0 = gets.split.map(&:to_i)
p f(n0, k0)
