#include <bits/stdc++.h>
using namespace std;
const int MAX = 7E5 + 10;
const int BASE = 1E6 + 3;
int n, p;
long long f[MAX];
long long power(int x, int n) {
  if (n == 0) return 1;
  long long tmp = power(x, n / 2);
  tmp = tmp * tmp;
  if (n % 2) tmp = tmp * x;
  tmp %= BASE;
  return tmp;
}
long long C(int k, int n) {
  return f[n] * power((f[n - k] * f[k]) % BASE, BASE - 2);
}
void init() {
  f[0] = 1;
  for (int i = 1; i < n + p; i++) f[i] = (f[i - 1] * i) % BASE;
}
int main() {
  scanf("%d%d", &n, &p);
  init();
  long long res = 0;
  for (int i = 1; i <= n; i++) res = (res + C(p - 1, i + p - 1)) % BASE;
  printf("%I64d", res);
}
