#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
const long long mod = 1e6 + 3;
long long bin_pow(long long a, long long c) {
  if (c == 0) return 1LL;
  if (c % 2)
    return bin_pow(a, c - 1) * a % mod;
  else {
    long long res = bin_pow(a, c / 2);
    return res * res % mod;
  }
}
long long inverse(long long a) { return bin_pow(a, mod - 2); }
long long C(int n, int m) {
  long long res = 1;
  for (int i = n - m + 1; i <= n; ++i) res = (res * i) % mod;
  for (int i = 1; i <= m; ++i) res = (res * inverse(i)) % mod;
  return res % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  int nn, mm;
  nn = n + m;
  mm = nn - m;
  cout << C(nn, mm) - 1 << endl;
}
