#include <bits/stdc++.h>
using namespace std;
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  for (int(i) = 0; (i) < (sz(t)); ++(i)) s << t[i] << " ";
  return s;
}
int r, n;
long long MOD = 1000003;
long long qp(long long a, long long b) {
  long long x = 1;
  while (b) {
    if (b & 1) x = x * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return x;
}
int main() {
  cin >> r >> n;
  long long ans = 0, cur = 1;
  for (int a = n, b = 1; b <= r; a++, b++) {
    cur = cur * a % MOD * qp(b, MOD - 2) % MOD;
    ans = (ans + cur) % MOD;
  }
  cout << ans << "\n";
}
