#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const long double PI = 4 * atan((long double)1);
const int INFTY = 1e7;
template <unsigned int N>
class Field {
  inline unsigned int pow(unsigned int a, unsigned int p) {
    unsigned int r = 1, e = a;
    while (p) {
      if (p & 1) {
        r = ((unsigned long long)r * e) % N;
      }
      e = ((unsigned long long)e * e) % N;
      p >>= 1;
    }
    return r;
  }
  inline unsigned int inv(unsigned int a) { return pow(a, N - 2); }

 public:
  inline Field(int x = 0) : v(x) {}
  inline Field<N> pow(int p) { return (*this) ^ p; }
  inline Field<N> operator^(int p) { return {(int)pow(v, (unsigned int)p)}; }
  inline Field<N> &operator+=(const Field<N> &o) {
    if (v + o.v >= N)
      v += o.v - N;
    else
      v += o.v;
    return *this;
  }
  inline Field<N> &operator-=(const Field<N> &o) {
    if (v < o.v)
      v -= o.v - N;
    else
      v -= o.v;
    return *this;
  }
  inline Field<N> &operator*=(const Field<N> &o) {
    v = (unsigned long long)v * o.v % N;
    return *this;
  }
  inline Field<N> &operator/=(const Field<N> &o) { return *this *= inv(o.v); }
  inline Field<N> operator+(const Field<N> &o) const {
    Field<N> r{*this};
    return r += o;
  }
  inline Field<N> operator-(const Field<N> &o) const {
    Field<N> r{*this};
    return r -= o;
  }
  inline Field<N> operator*(const Field<N> &o) const {
    Field<N> r{*this};
    return r *= o;
  }
  inline Field<N> operator/(const Field<N> &o) const {
    Field<N> r{*this};
    return r /= o;
  }
  inline Field<N> operator-() {
    if (v)
      return {(int)(N - v)};
    else
      return {0};
  };
  inline Field<N> &operator++() {
    ++v;
    if (v == N) v = 0;
    return *this;
  }
  inline Field<N> operator++(int) {
    Field<N> r{*this};
    ++*this;
    return r;
  }
  inline Field<N> &operator--() {
    --v;
    if (v == -1) v = N - 1;
    return *this;
  }
  inline Field<N> operator--(int) {
    Field<N> r{*this};
    --*this;
    return r;
  }
  inline bool operator==(const Field<N> &o) const { return o.v == v; }
  inline bool operator!=(const Field<N> &o) const { return o.v != v; }
  inline explicit operator unsigned int() const { return v; }
  inline static vector<Field<N>> fact(int t) {
    vector<Field<N>> F(t + 1, 1);
    for (int i = 2; i <= t; ++i) {
      F[i] = F[i - 1] * i;
    }
    return F;
  }
  inline static vector<Field<N>> invfact(int t) {
    vector<Field<N>> F(t + 1, 1);
    Field<N> X{1};
    for (int i = 2; i <= t; ++i) {
      X = X * i;
    }
    F[t] = 1 / X;
    for (int i = t - 1; i >= 2; --i) {
      F[i] = F[i + 1] * (i + 1);
    }
    return F;
  }

 private:
  unsigned int v;
};
template <unsigned int N>
istream &operator>>(std::istream &is, Field<N> &first) {
  unsigned int v;
  is >> v;
  first = v;
  return is;
}
template <unsigned int N>
ostream &operator<<(std::ostream &os, const Field<N> &first) {
  return os << (unsigned int)first;
}
template <unsigned int N>
Field<N> operator+(int i, const Field<N> &first) {
  return Field<N>(i) + first;
}
template <unsigned int N>
Field<N> operator-(int i, const Field<N> &first) {
  return Field<N>(i) - first;
}
template <unsigned int N>
Field<N> operator*(int i, const Field<N> &first) {
  return Field<N>(i) * first;
}
template <unsigned int N>
Field<N> operator/(int i, const Field<N> &first) {
  return Field<N>(i) / first;
}
int main() {
  long long n, C;
  cin >> n >> C;
  auto F = Field<1000003>::fact(n + C);
  auto I = Field<1000003>::invfact(((n) > (C) ? (n) : (C)));
  Field<1000003> ans = F[n + C] * I[n] * I[C] - 1;
  cout << ans << endl;
}
