逆元求组合数
思路:就是枚举每次分多少个数,从1到n,分成m份。因为可以取0,所以再补m个0进去
MOD = int(1e6) + 3
N = 5000010
fact, infact = [1] * N, [1] * N
for i in range(1, N):
fact[i] = fact[i - 1] * i % MOD
infact[i] = infact[i - 1] * pow(i, MOD - 2, MOD) % MOD
n, m = map(int, input().split())
res = 0
for i in range(1, n + 1):
a, b = i + m - 1, m - 1
res = (res + fact[a] * infact[b] * infact[a - b] % MOD) % MOD
print(res)