#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long tmp = power(x, y / 2);
  if (y % 2 == 0)
    return (tmp * tmp) % 1000003ll;
  else
    return (tmp * tmp * x) % 1000003ll;
}
long long inv(long long x) { return power(x, 1000003ll - 2); }
long long fact(long long x) {
  long long ret = 1;
  for (long long i = 1; i <= x; i++) ret = (ret * i) % 1000003ll;
  return ret;
}
long long n, r, ans;
int main() {
  cin >> n >> r;
  ans = fact(n + r);
  ans = (ans * inv(fact(r))) % 1000003ll;
  ans = (ans * inv(fact(n))) % 1000003ll;
  cout << (ans + 1000003ll - 1) % 1000003ll << endl;
  return 0;
}
