#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e6 + 3;
const int MAX = 1000005;
inline int ADD(int a, int b) { return a + b >= MOD ? a + b - MOD : a + b; }
inline int MUL(int a, int b) { return (long long)a * b % MOD; }
int n, c;
int fact[MAX];
int pot(int a, long long n) {
  int res = 1;
  while (n) {
    if (n & 1) res = MUL(res, a);
    a = MUL(a, a);
    n /= 2;
  }
  return res;
}
int inv(int a) {
  int res = pot(a, MOD - 2);
  return res;
}
int povrh(int n, int k) {
  int z1;
  int z2;
  int iz2;
  z1 = fact[n];
  z2 = MUL(fact[n - k], fact[k]);
  iz2 = inv(z2);
  return MUL(z1, iz2);
}
int kameni(int n, int c) {
  int res = 0;
  for (int i = 0; i < n; i++) {
    res = ADD(res, povrh(i + 1 + c - 1, c - 1));
  }
  return res;
}
int main() {
  cin >> n >> c;
  fact[0] = 1;
  for (int i = (1), _for = (MAX); i < _for; ++i) fact[i] = MUL(fact[i - 1], i);
  cout << kameni(n, c);
  return 0;
}
