map int input split if or print else for in range append for in range

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
n, k = map(int, input().split())
a = []
if n == 1 or k == 1:
print(1)
else:
for i in range(n):
a.append([])
for j in range(k):
a[i].append(1)
for i in range(n - 1):
for j in range(k - 1):
a[i + 1][j + 1] = a[i + 1][j] + a[i][j + 1]
print(a[n - 1][k - 1] % ((10 ** 6) + 7))