MOD = 1_000_000_007

n, k = gets.split.map(&:to_i)
table = Array.new(k + 1, 0)
table[0] = 1
n.times do
  new_table = Array.new(k + 1, 0)
  (1..k).each do |i|
    new_table[i] = (table[i - 1] + table[i] * i) % MOD
  end
  table = new_table
end
p table.inject(:+) % MOD
