#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
template <class T>
bool scanff(T &ret) {
  char c;
  int sgn;
  T bit = 0.1;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && c != '.' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  if (c == ' ' || c == '\n') {
    ret *= sgn;
    return 1;
  }
  while (c = getchar(), c >= '0' && c <= '9') ret += (c - '0') * bit, bit /= 10;
  ret *= sgn;
  return 1;
}
using namespace std;
long long inv[1000500];
long long mod = 1e6 + 3;
void init(long long p) {
  inv[1] = 1;
  for (int i = int(2); i <= int(p - 1); i++)
    inv[i] = (p - (p / i)) * inv[p % i] % p;
}
int main() {
  int n, c;
  init(mod);
  scanff(n);
  scanff(c);
  if (n == 1) {
    printf("%d\n", c);
  } else {
    long long ans = 0;
    long long pre = n;
    long long sd = n;
    long long xd = 1;
    long long num = n;
    ans += pre;
    for (int i = int(2); i <= int(c); i++) {
      sd++;
      xd++;
      pre = pre * sd * inv[xd] % mod;
      num += pre;
      num %= mod;
      ans += num;
      ans %= mod;
    }
    printf("%lld\n", num);
  }
  return 0;
}
