#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 + 3;
const long long NMAX = 1000 * 1000 + 11111;
long long arr[NMAX];
long long n, m, p, q, k;
vector<long long> ans;
string str;
char ch;
long long f[NMAX + 3];
long long power(long long x, long long y, long long m = MOD) {
  if (y == 0) return 1;
  long long p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long func(long long n, long long r) {
  return ((f[n + r]) * power((f[r] * f[n]) % MOD, MOD - 2)) % MOD;
}
void solve() {
  long long n, r;
  cin >> n >> r;
  f[0] = 1;
  for (long long i = 1; i <= NMAX; i++) {
    f[i] = (i * f[i - 1]) % MOD;
  }
  cout << func(n, r) - 1;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
}
