#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 2, mod = 1e6 + 3;
int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
int mul(long long a, int b) {
  a *= b;
  if (a >= mod) a %= mod;
  return a;
}
int pwm(int a, int p) {
  int m = a, ret = 1;
  while (p) {
    if (p & 1) ret = mul(ret, m);
    m = mul(m, m);
    p >>= 1;
  }
  return ret;
}
int fact[N];
int inv[N];
int nCr(int n, int r) { return mul(fact[n], mul(inv[r], inv[n - r])); }
int n, c;
int main() {
  fact[0] = 1;
  inv[0] = pwm(fact[0], mod - 2);
  for (int i = 1; i < N; i++) {
    fact[i] = mul(i, fact[i - 1]);
    inv[i] = pwm(fact[i], mod - 2);
  }
  scanf("%d", &n), scanf("%d", &c);
  int out = 0;
  for (int sum = 1; sum <= n; sum++) {
    out = add(out, nCr(sum + c - 1, sum));
  }
  printf("%d\n", out);
}
