#include <bits/stdc++.h>
typedef long long LL;
using namespace std;
const int M = 1e6 + 3;
const int N = 1e6 + 1;
LL fac[N];
LL powa(LL a, LL b) {
  if (b == 0) return 1;
  if (b % 2 == 1) return (powa(a, b - 1) * a) % M;
  LL c = powa(a, b / 2);
  return (c * c) % M;
}
LL inv(LL a) { return powa(a, M - 2); }
LL cho(LL a, LL b) {
  fac[0] = 1;
  for (LL i = 1; i <= a; i++) fac[i] = (fac[i - 1] * i) % M;
  LL ans = fac[a] * inv(fac[b]);
  ans %= M;
  ans = ans * inv(fac[a - b]);
  ans %= M;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cout.setf(ios::fixed);
  LL n, i, j, m, c;
  cin >> n >> c;
  LL ans = cho(n + c, n) - 1;
  cout << ans << '\n';
}
