#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 + 3;
long long pow(long long n, long long k) {
  if (k == 0) return 1;
  long long ans = pow(n, k / 2);
  if (k % 2 == 0) return (ans * ans) % MOD;
  return (ans * ans * n) % MOD;
}
long long fact(long long n) {
  long long ans = 1;
  for (long long i = 2; i <= n; i++) ans = (ans * i) % MOD;
  return ans;
}
long long c(long long k, long long n) {
  long long num1 = fact(n);
  long long num2 = (fact(k) * fact(n - k)) % MOD;
  return (num1 * pow(num2, MOD - 2)) % MOD;
}
int32_t main() {
  long long n, k;
  cin >> n >> k;
  cout << c(k, n + k) - 1 << endl;
  return 0;
}
