#include <bits/stdc++.h>
using namespace std;
const int MAXN = 700100;
const int MOD = int(1e6 + 3);
int fact[MAXN];
int invfact[MAXN];
int exp(int a, int b) {
  if (b == 0) return 1;
  if (b & 1) {
    return (long long)a * exp(a, b - 1) % MOD;
  }
  int tmp = exp(a, b / 2);
  return (long long)tmp * tmp % MOD;
}
int main() {
  fact[0] = invfact[0] = 1;
  for (int i = 1; i < MAXN; i++) {
    fact[i] = (long long)fact[i - 1] * i % MOD;
    invfact[i] = exp(fact[i], MOD - 2);
  }
  int n, c;
  cin >> n >> c;
  int res = ((long long)fact[n + c] * invfact[n] * invfact[c] - 1 + MOD) % MOD;
  cout << res << endl;
  return 0;
}
