#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
double PI = 3.1415926535897932384626433832795;
double EPS = 1e-2;
const int MAXN = 1000;
const int MAXC = 1e7;
const int mod = 1e6 + 3;
inline int mul(int a, int b) {
  if (a < 0) a += mod;
  if (b < 0) b += mod;
  return (a * (long long)b) % mod;
}
inline int sum(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
inline int pw(int base, int deg) {
  int res = 1;
  while (deg) {
    if (deg & 1) res = mul(base, res);
    base = mul(base, base);
    deg >>= 1;
  }
  return res;
}
inline int del(int a, int b) {
  b = pw(b, mod - 2);
  return mul(a, b);
}
int n, m;
int fac(int x) {
  int res = 1;
  for (int i = 2; i <= x; ++i) {
    res = mul(res, i);
  }
  return res;
}
void solve() {
  cin >> n >> m;
  cout << sub(del(del(fac(n + m), fac(m)), fac(n)), 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  srand(1313);
  int t = 1;
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
