#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000000 + 5;
const int inf = 0x3f3f3f3f;
const long long mod = 1e6 + 3;
long long f[maxn];
void init(long long p) {
  f[0] = 1;
  for (int i = 1; i <= 700000; i++) f[i] = f[i - 1] * i % p;
}
long long quick_mod(long long a, long long b, long long m) {
  long long ans = 1;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % m;
      b--;
    }
    b /= 2;
    a = a * a % m;
  }
  return ans;
}
long long lucas(long long n, long long k, long long p) {
  long long ret = 1;
  while (n && k) {
    long long nn = n % p, kk = k % p;
    if (nn < kk) return 0;
    ret = ret * f[nn] * quick_mod(f[kk] * f[nn - kk] % p, p - 2, p) % p;
    n /= p;
    k /= p;
  }
  return ret;
}
int main() {
  long long n, m;
  init(mod);
  while (cin >> n >> m) {
    long long a = max(n, m);
    long long b = min(n, m);
    long long c = lucas(a + b, b, mod) - 1;
    cout << c << endl;
  }
  return 0;
}
