using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO.Pipes;
using System.Runtime;
 
namespace Csharponly
{
    class Program
    {
        static public void Main()
        {
            int[] NK = Arrayint();
 
            string ans = Team(NK[0] + 1, NK[1]);
			
          	long a = long.Parse(ans);
          	long b = a%1000000007;
            Console.WriteLine(b);
 
        }
 
 
        static string Team(int a, int b)
        {
            string ans = "1";
            for (int i = b; i < a; i++)
            {
 
                ans = Tasu(Tasu(ans ,Kakeru((a - i).ToString(),i.ToString())),"1");
 				//Console.WriteLine(ans);
            }
            return ans;
        }
 
        //b*(b+1)*(b*2)* *a
        static int Warunum(int aa, int bb)
        {
            int cc = 1;
            for (int i = bb; i < aa; i++)
            {
                cc = cc * i;
            }
            return cc;
        }
 
        static string Kakeru(string a1, string b1)
        {
            int anum = a1.Length;
            int bnum = b1.Length;
            int[] a = Array(a1);
            int[] b = Array(b1);
 
            int[] kakeruans = new int[anum + bnum];
            for(int i = 0; i < anum; i++)
            {
                for(int j = 0; j < bnum; j++)
                {
                    kakeruans[i + j] += a[i] * b[j];
                }
            }
            for(int i = 0; i < kakeruans.Length; i++)
            {
                if(kakeruans[i] >= 10)
                {
                    kakeruans[i + 1] += kakeruans[i] / 10;
                    kakeruans[i] = kakeruans[i] % 10;
                }
            }
            string kakerustring = "";
            for (int i = 0; i < kakeruans.Length - 1; i++)
            {
                kakerustring = kakeruans[i].ToString() + kakerustring;
            }
            if (kakeruans[kakeruans.Length - 1] != 0)
            {
                kakerustring = kakeruans[kakeruans.Length - 1].ToString() + kakerustring;
            }
 
            return kakerustring;
        }
 
        static string Tasu(string a1, string b1)
        {
            int anum = a1.Length;
            int bnum = b1.Length;
            int[] a = Array(a1);
            int[] b = Array(b1);
 
            string tasustring = "";
            if (anum < bnum)
            {
                int[] tasuans = new int[bnum + 1];
                for (int i = 0; i < anum; i++)
                {
                    tasuans[i] = a[i] + b[i];
                }
                for(int i = anum; i < bnum; i++)
                {
                    tasuans[i] = b[i];
                }
                for(int i = 0; i < tasuans.Length; i++)
                {
                    if(tasuans[i] >= 10)
                    {
                        tasuans[i] -= 10;
                        tasuans[i + 1]++; 
                    }
                }
                for (int i = 0; i < tasuans.Length - 1; i++)
                {
                    tasustring = tasuans[i].ToString() + tasustring;
                }
                if(tasuans[tasuans.Length - 1] != 0)
                {
                    tasustring = tasuans[tasuans.Length - 1].ToString() + tasustring;
                }
            }
            else
            {
                int[] tasuans = new int[anum + 1];
                for (int i = 0; i < bnum; i++)
                {
                    tasuans[i] = a[i] + b[i];
                }
                for (int i = bnum; i < anum; i++)
                {
                    tasuans[i] = a[i];
                }
                for (int i = 0; i < tasuans.Length; i++)
                {
                    if (tasuans[i] >= 10)
                    {
                        tasuans[i] -= 10;
                        tasuans[i + 1]++;
                    }
                }
                for (int i = 0; i < tasuans.Length - 1 ; i++)
                {
                    tasustring = tasuans[i].ToString() + tasustring;
                }
                if (tasuans[tasuans.Length - 1] != 0)
                {
                    tasustring = tasuans[tasuans.Length - 1].ToString() + tasustring;
                }               
            }
            return tasustring;
        }
 
        static int[] Array(string A)
        {
            int[] a = new int[A.Length];
            string num;
            for (int i = 0; i < A.Length; i++)
            {
                num = A.Substring(i, 1);
                a[A.Length - i - 1] = int.Parse(num);
            }
 
            return a;
        }
 
        //一つの文字列を受け渡す
        static string Onestring()
        {
            return Console.ReadLine();
        }
 
        //複数の文字列を配列で受け渡す
        //文字列と文字列の間は" "で区切る
        static string[] Arraystring()
        {
            return Console.ReadLine().Split(' ');
        }
 
        //一つの数字を受け渡す
        static int Oneint()
        {
            return int.Parse(Console.ReadLine());
        }
 
        //複数の数字を配列で受け渡す
        //数字と数字の間は" "で区切る
        static int[] Arrayint()
        {
            String[] input_line = Console.ReadLine().Split(' ');
            int[] input_num = new int[input_line.Length];
            for (int i = 0; i < input_line.Length; i++)
            {
                input_num[i] = int.Parse(input_line[i]);
            }
            return input_num;
        }
    }
}

Measured memory_bytes: 40480