#include <bits/stdc++.h>
using namespace std;
const int N = 7e5 + 5, MOD = 1e6 + 3, MAXN = 1e5, LG = 20, M = 1e7, P = 727,
          Sq = 100;
const long long inf = 1e18 + 10;
int fac[N], inv[N];
int pw(int a, int b) {
  if (!b) return 1;
  int tmp = pw(a, b / 2);
  tmp = 1ll * tmp * tmp % MOD;
  if (b % 2) tmp = 1ll * tmp * a % MOD;
  return tmp;
}
int ENT(int a, int b) {
  if (a > b) return 0;
  if (!a || a == b) return 1;
  int ret = 1ll * fac[b] * inv[a] % MOD;
  ret = 1ll * ret * inv[b - a] % MOD;
  return ret;
}
int main() {
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1ll * fac[i - 1] * i % MOD;
  inv[N - 1] = pw(fac[N - 1], MOD - 2);
  for (int i = N - 2; i >= 1; i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % MOD;
  int n, m, ans = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) ans = (ans + ENT(m - 1, m - 1 + i)) % MOD;
  return cout << ans, 0;
}
