#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
template <class T>
int sgn(T x) {
  return x > 0 ? 1 : (x < 0 ? -1 : 0);
}
const long double pi = 2 * asinl((long double)1.0);
int n;
int m;
const int mod = 1e6 + 3;
const int N = 1e6;
int fact[N], fact_inv[N];
int cnk(int n, int k) {
  return (((long long)fact[n] * fact_inv[k]) % mod * fact_inv[n - k]) % mod;
}
int power(int x, int m) {
  int res = 1;
  while (m) {
    if (m & 1) res = ((long long)res * x) % mod;
    x = ((long long)x * x) % mod;
    m >>= 1;
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = ((long long)fact[i - 1] * i) % mod;
  for (int i = 0; i < N; i++) fact_inv[i] = power(fact[i], mod - 2);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = (ans + cnk(i - 1 + m, m - 1)) % mod;
  }
  cout << ans << endl;
  return 0;
}
