#include <bits/stdc++.h>
using namespace std;
const long long M = 1e6 + 3;
const long long N = 1e6 + 5;
vector<long long> fact(N), ifact(N);
long long inv(long long x) {
  long long res = 1;
  long long b = M - 2;
  while (b) {
    if (b & 1) res = (res * x) % M;
    x = (x * x) % M;
    b >>= 1;
  }
  return res;
}
void init() {
  fact[0] = 1;
  for (long long i = 1; i < N; i++) fact[i] = (fact[i - 1] * i) % M;
  ifact[(long long)1e6] = inv(fact[(long long)1e6]);
  for (long long i = (long long)1e6 - 1; i >= 0; i--)
    ifact[i] = (ifact[i + 1] * (i + 1)) % M;
}
long long ncr(long long n, long long r) {
  if (r > n) return 0;
  long long res = fact[n];
  res = (res * ifact[r]) % M;
  res = (res * ifact[n - r]) % M;
  return res;
}
void solve() {
  long long n, c;
  cin >> n >> c;
  cout << ((ncr(n + c, c) - 1 + M) % M);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  init();
  long long t = 1;
  while (t--) solve();
}
