#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e6 + 3;
const int64_t N = 1e6 + 5;
int64_t mpow(int64_t x, int64_t y) {
  if (y == 0) return 1;
  int64_t temp = mpow(x, y / 2);
  temp *= temp;
  temp %= MOD;
  if (y & 1) temp *= x;
  return temp % MOD;
}
int64_t fact[1000000];
int64_t ifact[1000000];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fact[0] = 1;
  ifact[0] = 1;
  for (int64_t i = 1; i < 1000000; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= MOD;
    ifact[i] = mpow(fact[i], MOD - 2);
  }
  int64_t n, c;
  cin >> n >> c;
  int64_t ans = fact[n + c];
  ans *= ifact[n];
  ans %= MOD;
  ans *= ifact[c];
  ans %= MOD;
  ans += (MOD - 1);
  ans %= MOD;
  cout << ans;
  return 0;
}
