#include <bits/stdc++.h>
const int N = 1111111;
const int MOD = (int)(1e6 + 3);
using namespace std;
int n, m;
long long fac[N], inv[N];
long long pw(long long a, long long b) {
  long long ans = 1;
  for (; b; b /= 2, a = (a * a) % MOD) {
    if (b & 1) ans = (ans * a) % MOD;
  }
  return ans;
}
long long comb(int n, int m) {
  return (((fac[n] * inv[m]) % MOD) * inv[n - m]) % MOD;
}
int main() {
  fac[0] = inv[0] = 1;
  for (int i = 1; i < N; ++i) {
    fac[i] = (fac[i - 1] * i) % MOD;
    inv[i] = pw(fac[i], MOD - 2);
  }
  cin >> n >> m;
  long long ans = 0;
  for (int i = 1; i <= n; ++i) ans = (ans + comb(i + m - 1, m - 1)) % MOD;
  cout << ans << endl;
  return 0;
}
