#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e6 + 3;
long long pow_mod(long long a, long long p) {
  long long res = 1;
  while (p) {
    if (p & 1) res = res * a % mod;
    a = a * a % mod;
    p >>= 1;
  }
  return res;
}
long long GetC(long long n, long long m) {
  if (n < m) return 0;
  if (m > n - m) m = n - m;
  long long s1 = 1, s2 = 1;
  for (long long i = 0; i < m; ++i) {
    s1 = (s1 * (n - i)) % mod;
    s2 = (s2 * (i + 1)) % mod;
  }
  return s1 * pow_mod(s2, mod - 2) % mod;
}
int main() {
  long long n, C;
  scanf("%lld %lld", &n, &C);
  long long res = GetC(n + C, C) - 1;
  printf("%lld\n", res);
  return 0;
}
