import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right


def combination_mod(n, r, mod):
    # if r > n:
    #     return 0  # このような通りの数は無いため便宜上こう定義する
    r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
    return nf * pow(rf, mod - 2, mod) % mod


def ret_list_combination_mod(n, r, mod):
    ret = [1]
    if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    # r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
        ret.append(nf * pow(rf, mod - 2, mod) % mod)
    return ret

# https://atcoder.jp/contests/abc156/tasks/abc156_e


MOD = 10**9 + 7
n, k = read_ints()
# n<=kのときは簡単
if n <= k:
    print(combination_mod(n + n - 1, n, MOD))
    exit()
# n>kのときはどうしよう

ans = 1
nCa = ret_list_combination_mod(n, k, MOD)
n_1Ca = ret_list_combination_mod(n - 1, k, MOD)
for a in range(1, k + 1):
    ans += nCa[a] * n_1Ca[a]  # ここ高速化しないと厳しいかな
    ans %= MOD
print(ans) import sys sys sys.setrecursionlimit(1 << 25) sys.setrecursionlimit sys setrecursionlimit 1 << 25 1 25 read = sys.stdin.readline read sys.stdin.readline sys.stdin sys stdin readline ra = range ra range enu = enumerate enu enumerate def read_ints():
    return list(map(int, read().split())) read_ints return list(map(int, read().split())) list(map(int, read().split())) list map(int, read().split()) map int read().split() ().split () read split def read_a_int():
    return int(read()) read_a_int return int(read()) int(read()) int read() read def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret read_tuple '''
    H is number of rows
    ''' ret = [] ret [] for _ in range(H):
        ret.append(tuple(map(int, read().split())))
     _ range(H) range H ret.append(tuple(map(int, read().split()))) ret.append ret append tuple(map(int, read().split())) tuple map(int, read().split()) map int read().split() ().split () read split return ret ret H H def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret))) read_col '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    ''' ret = [] ret [] for _ in range(H):
        ret.append(list(map(int, read().split())))
     _ range(H) range H ret.append(list(map(int, read().split()))) ret.append ret append list(map(int, read().split())) list map(int, read().split()) map int read().split() ().split () read split return tuple(map(list, zip(*ret))) tuple(map(list, zip(*ret))) tuple map(list, zip(*ret)) map list zip(*ret) zip *ret ret H H def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため read_matrix '''
    H is number of rows
    ''' ret = [] ret [] for _ in range(H):
        ret.append(list(map(int, read().split())))
     _ range(H) range H ret.append(list(map(int, read().split()))) ret.append ret append list(map(int, read().split())) list map(int, read().split()) map int read().split() ().split () read split return ret ret H H MOD = 10**9 + 7 MOD 10**9 + 7 10**9 10 9 7 INF = 2**31 INF 2**31 2 31 from collections import defaultdict, Counter, deque from operator import itemgetter from itertools import product, permutations, combinations from bisect import bisect_left, bisect_right def combination_mod(n, r, mod):
    # if r > n:
    #     return 0  # このような通りの数は無いため便宜上こう定義する
    r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
    return nf * pow(rf, mod - 2, mod) % mod combination_mod r = min(r, n - r) r min(r, n - r) min r n - r n r nf = rf = 1 nf 1 = rf = 1 rf 1 for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
     i range(r) range r nf = nf * (n - i) % mod nf nf * (n - i) % mod nf * (n - i) nf n - i n i mod rf = rf * (i + 1) % mod rf rf * (i + 1) % mod rf * (i + 1) rf i + 1 i 1 mod return nf * pow(rf, mod - 2, mod) % mod nf * pow(rf, mod - 2, mod) % mod nf * pow(rf, mod - 2, mod) nf pow(rf, mod - 2, mod) pow rf mod - 2 mod 2 mod mod n n r r mod mod def ret_list_combination_mod(n, r, mod):
    ret = [1]
    if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    # r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
        ret.append(nf * pow(rf, mod - 2, mod) % mod)
    return ret

# https://atcoder.jp/contests/abc156/tasks/abc156_e ret_list_combination_mod ret = [1] ret [1] 1 if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    # r = min(r, n - r)
     r > n r n return 0 0 nf = rf = 1 nf 1 = rf = 1 rf 1 for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
        ret.append(nf * pow(rf, mod - 2, mod) % mod)
     i range(r) range r nf = nf * (n - i) % mod nf nf * (n - i) % mod nf * (n - i) nf n - i n i mod rf = rf * (i + 1) % mod rf rf * (i + 1) % mod rf * (i + 1) rf i + 1 i 1 mod ret.append(nf * pow(rf, mod - 2, mod) % mod) ret.append ret append nf * pow(rf, mod - 2, mod) % mod nf * pow(rf, mod - 2, mod) nf pow(rf, mod - 2, mod) pow rf mod - 2 mod 2 mod mod return ret ret n n r r mod mod MOD = 10**9 + 7 MOD 10**9 + 7 10**9 10 9 7 n, k = read_ints() n read_ints() read_ints k if n <= k:
    print(combination_mod(n + n - 1, n, MOD))
    exit()
# n>kのときはどうしよう n <= k n k print(combination_mod(n + n - 1, n, MOD)) print combination_mod(n + n - 1, n, MOD) combination_mod n + n - 1 n + n n n 1 n MOD exit() exit ans = 1 ans 1 nCa = ret_list_combination_mod(n, k, MOD) nCa ret_list_combination_mod(n, k, MOD) ret_list_combination_mod n k MOD n_1Ca = ret_list_combination_mod(n - 1, k, MOD) n_1Ca ret_list_combination_mod(n - 1, k, MOD) ret_list_combination_mod n - 1 n 1 k MOD for a in range(1, k + 1):
    ans += nCa[a] * n_1Ca[a]  # ここ高速化しないと厳しいかな
    ans %= MOD a range(1, k + 1) range 1 k + 1 k 1 ans += nCa[a] * n_1Ca[a] ans nCa[a] * n_1Ca[a] nCa[a] nCa a n_1Ca[a] n_1Ca a ans %= MOD ans MOD print(ans) print ans def read_a_int():
    return int(read()) def read_a_int():
    return int(read()) read_a_int ans %= MOD MOD ans MOD = 10**9 + 7 10**9 + 7 MOD enu = enumerate enumerate enu INF = 2**31 2**31 INF nCa = ret_list_combination_mod(n, k, MOD) ret_list_combination_mod(n, k, MOD) nCa ans += nCa[a] * n_1Ca[a] nCa[a] * n_1Ca[a] ans def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため read_matrix def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret read_tuple def ret_list_combination_mod(n, r, mod):
    ret = [1]
    if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    # r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
        ret.append(nf * pow(rf, mod - 2, mod) % mod)
    return ret

# https://atcoder.jp/contests/abc156/tasks/abc156_e def ret_list_combination_mod(n, r, mod):
    ret = [1]
    if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    # r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
        ret.append(nf * pow(rf, mod - 2, mod) % mod)
    return ret

# https://atcoder.jp/contests/abc156/tasks/abc156_e ret_list_combination_mod read = sys.stdin.readline sys.stdin.readline read MOD = 10**9 + 7 10**9 + 7 MOD ans = 1 1 ans n_1Ca = ret_list_combination_mod(n - 1, k, MOD) ret_list_combination_mod(n - 1, k, MOD) n_1Ca def read_ints():
    return list(map(int, read().split())) def read_ints():
    return list(map(int, read().split())) read_ints def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret))) def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret))) read_col def combination_mod(n, r, mod):
    # if r > n:
    #     return 0  # このような通りの数は無いため便宜上こう定義する
    r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
    return nf * pow(rf, mod - 2, mod) % mod def combination_mod(n, r, mod):
    # if r > n:
    #     return 0  # このような通りの数は無いため便宜上こう定義する
    r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
    return nf * pow(rf, mod - 2, mod) % mod combination_mod k = read_ints() read_ints() k ra = range range ra n, k = read_ints() read_ints() n
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right


def combination_mod(n, r, mod):
    # if r > n:
    #     return 0  # このような通りの数は無いため便宜上こう定義する
    r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
    return nf * pow(rf, mod - 2, mod) % mod


def ret_list_combination_mod(n, r, mod):
    ret = [1]
    if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    # r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
        ret.append(nf * pow(rf, mod - 2, mod) % mod)
    return ret

# https://atcoder.jp/contests/abc156/tasks/abc156_e


MOD = 10**9 + 7
n, k = read_ints()
# n<=kのときは簡単
if n <= k:
    print(combination_mod(n + n - 1, n, MOD))
    exit()
# n>kのときはどうしよう

ans = 1
nCa = ret_list_combination_mod(n, k, MOD)
n_1Ca = ret_list_combination_mod(n - 1, k, MOD)
for a in range(1, k + 1):
    ans += nCa[a] * n_1Ca[a]  # ここ高速化しないと厳しいかな
    ans %= MOD
print(ans)
