#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int N = 1e6 + 10, INF = 0x3f3f3f3f, MOD = 1e6 + 3;
long long inv[MOD], fact[N], finv[MOD];
long long C(int n, int m) {
  return fact[n] * finv[m] % MOD * finv[n - m] % MOD;
}
int main() {
  ios_base::sync_with_stdio(0);
  clock_t _ = clock();
  fact[0] = finv[0] = 1;
  inv[1] = fact[1] = finv[1] = 1;
  for (int i = 2; i < MOD; ++i) {
    inv[i] = (MOD - MOD / i) * inv[MOD % i] % MOD;
    fact[i] = fact[i - 1] * i % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    long long ans = 0;
    for (int i = 1; i <= n; ++i) {
      ans += C(i + m - 1, m - 1);
      if (ans >= MOD) ans -= MOD;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
