# https://www.acmicpc.net/problem/2225
# 참고 링크 : https://suri78.tistory.com/105

from sys import stdin
input = stdin.readline

N, K = map(int, input().split())

dp = [[1] * (N+1) for _ in range(K)]

for r in range(1, K):
    for c in range(1, N+1):
        dp[r][c] = dp[r-1][c] + dp[r][c-1]

# for row in dp:
    # print(row)

print(dp[K-1][N] % 1000000000)
af42a5217dbcd80b8dc679ec436fe0b34d9cd7ad
<mask token>

<mask token>
for r in range(1, K):
    for c in range(1, N + 1):
        dp[r][c] = dp[r - 1][c] + dp[r][c - 1]
print(dp[K - 1][N] % 1000000000)

<mask token>
input = stdin.readline
N, K = map(int, input().split())
dp = [([1] * (N + 1)) for _ in range(K)]
for r in range(1, K):
    for c in range(1, N + 1):
        dp[r][c] = dp[r - 1][c] + dp[r][c - 1]
print(dp[K - 1][N] % 1000000000)

from sys import stdin
input = stdin.readline
N, K = map(int, input().split())
dp = [([1] * (N + 1)) for _ in range(K)]
for r in range(1, K):
    for c in range(1, N + 1):
        dp[r][c] = dp[r - 1][c] + dp[r][c - 1]
print(dp[K - 1][N] % 1000000000)

# https://www.acmicpc.net/problem/2225
# 참고 링크 : https://suri78.tistory.com/105

from sys import stdin
input = stdin.readline

N, K = map(int, input().split())

dp = [[1] * (N+1) for _ in range(K)]

for r in range(1, K):
    for c in range(1, N+1):
        dp[r][c] = dp[r-1][c] + dp[r][c-1]

# for row in dp:
    # print(row)

print(dp[K-1][N] % 1000000000)