#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e6 + 3;
int i, n, c, x, y, z;
long long fact[1000005], rs, dp[500005], coef;
long long Pow(long long a, long long b) {
  long long ans = 1;
  while (b)
    if (b & 1)
      ans *= a, ans %= MOD, --b;
    else
      a *= a, a %= MOD, b /= 2;
  return ans;
}
long long C(int n, int m) {
  long long ans = (1LL * fact[n] * Pow(fact[m], MOD - 2)) % MOD;
  ans *= Pow(fact[n - m], MOD - 2);
  ans %= MOD;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> c;
  for (i = fact[0] = 1; i <= 1000000; ++i)
    fact[i] = (1LL * fact[i - 1] * i) % MOD;
  x = max(n, c);
  y = min(n, c);
  z = 1;
  while (y--) rs = (rs + C(x, z)) % MOD, ++x, ++z;
  cout << rs << '\n';
  return 0;
}
