Heidi the Cow is aghast: cracks in the northern Wall? Zombies gathering outside, forming groups, preparing their assault? This must not happen! Quickly, she fetches her HC2 (Handbook of Crazy Constructions) and looks for the right chapter:How to build a wall:  Take a set of bricks.  Select one of the possible wall designs. Computing the number of possible designs is left as an exercise to the reader.  Place bricks on top of each other, according to the chosen design. This seems easy enough. But Heidi is a Coding Cow, not a Constructing Cow. Her mind keeps coming back to point 2b. Despite the imminent danger of a zombie onslaught, she wonders just how many possible walls she could build with up to n bricks.A wall is a set of wall segments as defined in the easy version. How many different walls can be constructed such that the wall consists of at least 1 and at most n bricks? Two walls are different if there exist a column c and a row r such that one wall has a brick in this spot, and the other does not.Along with n, you will be given C, the width of the wall (as defined in the easy version). Return the number of different walls modulo 106 + 3.

The first line contains two space-separated integers n and C, 1 ≤ n ≤ 500000, 1 ≤ C ≤ 200000.

Print the number of different walls that Heidi could build, modulo 106 + 3.

NoteThe number 106 + 3 is prime.In the second sample case, the five walls are:             B        BB., .B, BB, B., and .BIn the third sample case, the nine walls are the five as in the second sample case and in addition the following four: B    BB    B  B        BB., .B, BB, and BB

import java.io.*;
import java.util.*;
public class wall2
{
    public static void main(String args[])throws IOException
    {
        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        Scanner ex=new Scanner(System.in);
        int n=ex.nextInt();
        int c=ex.nextInt();
        long ans=1,inverse;
        n=n+c;
        for(int i=n;i>n-c;i--)
        {
            ans=(ans*(i%1000003))%1000003;
        }
        for(int i=2;i<=c;i++)
        {
            inverse=power(i,1000001);
            ans=(ans*(inverse%1000003))%1000003;
        }
        System.out.println(ans-1);
    }
    public static long power(int i,int pow)
    {
        if(pow==0)
        return 1;
        long inv=power(i,pow/2);
        inv=(inv*inv)%1000003;
        if(pow%2==0)
        return inv;
        else
        return (((long)i*inv)%1000003);
    }
}

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		new D2().solve();
	}
}

class D2 {

	InputReader in = new InputReader(System.in);
	PrintWriter out = new PrintWriter(System.out);

	final long Mod = 1000003L ;

	long pow(long x , long y){
		 long res = 1L ;
		 for(; y > 0 ; y >>= 1){
			 if((y&1) > 0){
				 res *= x ;
				 res %= Mod ;
			 }
			 x *= x ;
			 x %= Mod ;
		 }
         return res ;
	}

	final int N = 700008 ;
	long[] dp = new long[N] ;

	void solve() {

		 long n = in.nextLong() ;
		 long m = in.nextLong() ;

		 dp[(int)m] = 1 ;
		 for(long i = m ; i >=2 ; i--){
			 dp[(int) m] *= i ;
			 dp[(int) m] %= Mod ;
		 }

		 for(long i = m+1 ; i < n+m ; i++){
			 dp[(int) i] = dp[(int)i-1] * i  ;
			 dp[(int) i] %= Mod ;
			 dp[(int) i] *= pow(i - m + 1  , Mod-2)  ;
			 dp[(int) i] %= Mod ;
		 }

		 long sum = 0L ;
		 for(long i = m ; i < n+m ; i++){
			 sum += dp[(int)i] ;
			 sum %= Mod ;
		 }

		 for(int i = 1 ; i < m ; i++){
			 sum *= pow(i , Mod-2) ;
			 sum %= Mod ;
		 }

		 out.println(sum)  ;
		 out.flush() ;
	}

}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tokenizer = new StringTokenizer("") ;
	}

	private void eat(String s){
		tokenizer = new StringTokenizer(s) ;
	}

	public String nextLine(){
		try {
			return reader.readLine() ;
		} catch (Exception e) {
			return null ;
		}
	}

	public boolean hasNext(){
		while(!tokenizer.hasMoreTokens()){
			String s = nextLine() ;
			if(s == null) return false ;
			eat(s) ;
		}
		return true ;
	}

	public String next() {
		hasNext() ;
		return tokenizer.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public BigInteger nextBigInteger() {
		return new BigInteger(next());
	}

}

import java.io.*;
import java.util.*;

public class HelveticqE {

    static final int mod = (int)1e6 + 3;

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);

        int n = in.nextInt();
        int c = in.nextInt();

        long fact[] = new long[n + c + 2];
        fact[0] = 1;
        for (int i = 1; i < fact.length; i++)
            fact[i] = (fact[i - 1] * i) % mod;

        long ans = fact[n + c];
        ans *= pow(fact[n], mod - 2);
        ans %= mod;
        ans *= pow(fact[c], mod - 2);
        ans %= mod;
        ans -= 1;
        ans += mod;
        ans %= mod;

        w.println(ans);
        w.close();
    }

    static long pow(long a, int b) {
        if (b == 0)
            return 1;
        long t = pow(a, b >> 1);
        t = (t * t) % mod;
        if(b % 2 == 1)
            t = (t * a) % mod;
        return t;
    }
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}

/*Author LAVLESH*/
import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class solution{
	static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static StringTokenizer st=new StringTokenizer("");

	static public String next() {
	        while (st == null || !st.hasMoreTokens()) {
	            try {
	                st = new StringTokenizer(br.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return st.nextToken();
	    }

	static int mod=1000003;
	static int inv(int a){
		return BigInteger.valueOf(a).modInverse(BigInteger.valueOf(mod)).intValue();
	}
	public static void main(String[]args)throws IOException{
		PrintWriter op =new PrintWriter(System.out,true);
		long ans;
		int n=Integer.parseInt(next());
		 int m=Integer.parseInt(next());
		int num=1,den=1;
		 for(int i=1;i<=m;i++)
		 {
			 num=(int)((long)num*(n+i)%mod);
			 den=(int)((long)den*i%mod);
		 }
	ans=(((long)num*inv(den)%mod)+mod)%mod;
		op.println(ans-1);

		 op.close();
  }
}

/*Author LAVLESH*/
import java.util.*;
import java.io.*;
public class solution{
	static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static StringTokenizer st=new StringTokenizer("");

	static public String next() {
	        while (st == null || !st.hasMoreTokens()) {
	            try {
	                st = new StringTokenizer(br.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return st.nextToken();
	    }
	static long[]rc =new long[1000001];
	static int mod=1000003;
	static long inv(long a,int m){
		if(a==1)return 1;
		return inv(m%a,m)*(m-m/a)%m;
	}
	public static void main(String[]args)throws IOException{
		PrintWriter op =new PrintWriter(System.out,true);
		 int n=Integer.parseInt(next());
		 int m=Integer.parseInt(next());
		rc[m]=1;
		 for(int i=m+1;i<=n+m;i++)
			rc[i]=rc[i-1]*i%mod*inv(i-m,mod)%mod;
		op.println(rc[n+m]-1);

		 op.close();
  }
}

import java.io.*;
import java.util.*;

public class A {

	static int[] fac;
	static int N = 2*500005;
	static int MOD = (int) 1e6 + 3;

	static int multiset(int n, int k) {
		return nck(n + k - 1, k);
	}

	static int nck(int n, int k) {
		if (k > n) {
			return 0;
		}
		int num = fac[n];
		int den = modInverse((int) (fac[k] * 1L * fac[n - k] % MOD));
		return (int) (num * 1L * den % MOD);
	}

	static void proceesFac() {
		fac = new int[N];
		fac[0] = 1;
		for (int i = 1; i < N; i++)
			fac[i] = (int) (i * 1L * fac[i - 1] % MOD);
	}

	static int pow(long b, int e) {
		long ans = 1;
		while (e > 0) {
			if (e % 2 == 1)
				ans = ans * b % MOD;
			e >>= 1;
			b = b * b % MOD;
		}
		return (int) ans;
	}

	static int modInverse(int x) {
		return pow(x, MOD - 2);
	}

	static int starsAndBars(int n, int k) {
		return multiset(n + 1, k - 1);
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = sc.nextInt(), c = sc.nextInt(), ans = 0;
		proceesFac();
		for (int i = 1; i <= n; i++) {
			ans += starsAndBars(i, c);
			if(ans>=MOD)
				ans-=MOD;
		}
		out.println(ans);
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		boolean ready() throws IOException {
			return br.ready();
		}

	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD2 solver = new TaskD2();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD2 {
        int mod = 1_000_003;
        int maxFact;
        long[] _fact;
        long[] _invFact;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int c = in.nextInt();
            maxFact = n + c;
            long ans = 0;
            for (int i = 1; i <= n; i++) {
                ans = (ans + bin(c + i - 1, i)) % mod;
            }
            out.println(ans);
        }

        long pow(long a, long b) {
            if (b == 0) return 1;
            if (b == 1) return a;
            long tmp = pow(a, b / 2);
            tmp = (tmp * tmp) % mod;
            if (b % 2 == 0) {
                return tmp;
            }
            return (tmp * a) % mod;
        }

        long bin(int n, int k) {
            if (k > n) return 0;
            if (_fact == null) {
                _fact = new long[maxFact + 1];
                _invFact = new long[maxFact + 1];
                _fact[0] = 1;
                _invFact[0] = 1;
                for (int i = 1; i <= maxFact; i++) {
                    _fact[i] = (_fact[i - 1] * i) % mod;
                    _invFact[i] = pow(_fact[i], mod - 2);
                }
            }
            return _fact[n] * _invFact[k] * _invFact[n - k];
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String next() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import static java.lang.Double.parseDouble;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class D2 {

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	static final int MOD = 1000003;

	static int sub(int a, int b) {
		int res = a - b;
		if (res < 0) {
			res += MOD;
		}
		return res;
	}

	static int mul(int a, int b) {
		return (int) ((long) a * b % MOD);
	}

	static int inv(int a) {
		return BigInteger.valueOf(a).modInverse(BigInteger.valueOf(MOD)).intValue();
	}

	static void solve() throws Exception {
		int n = nextInt();
		int c = nextInt();
		int num = 1, den = 1;
		for (int i = 0; i < c; i++) {
			num = mul(num, n + i + 1);
			den = mul(den, i + 1);
		}
		out.print(sub(mul(num, inv(den)), 1));
	}

	static int nextInt() throws IOException {
		return parseInt(next());
	}

	static long nextLong() throws IOException {
		return parseLong(next());
	}

	static double nextDouble() throws IOException {
		return parseDouble(next());
	}

	static String next() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public static void main(String[] args) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			exit(1);
		}
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.math.BigInteger;
import java.io.IOException;
import java.io.InputStream;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Alex
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD2 solver = new TaskD2();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskD2 {
        long MOD = 1000 * 1000 + 3;
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt() - 1, k = in.readInt();
            out.printLine(IntegerUtils.binomialCoefficient(n + k + 1, n + 1, MOD) - 1);
        }
    }
    static class OutputWriter {
        private final PrintWriter writer;
        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }
        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }
        public void close() {
            writer.close();
        }
        public void printLine(long i) {
            writer.println(i);
        }
    }
    static class IntegerUtils {
        public static long factorial(int n, long mod) {
            long result = 1;
            for (int i = 2; i <= n; i++)
                result = result * i % mod;
            return result % mod;
        }
        public static long binomialCoefficient(int n, int m, long mod) {
            if (m < 0 || m > n)
                return 0;
            if (2 * m > n)
                m = n - m;
            long result = 1;
            for (int i = n - m + 1; i <= n; i++)
                result = result * i % mod;
            return result * BigInteger.valueOf(factorial(m, mod)).modInverse(BigInteger.valueOf(mod)).longValue() % mod;
        }
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }
        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MottoX
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD2 solver = new TaskD2();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD2 {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt(), m = in.nextInt();
            int mod = (int) 1e6 + 3;
            long ret = 0;
            int[] fac = MathUtils.getFactorials(1000001, mod);
            for (int i = 1; i <= n; i++) {
                ret += MathUtils.C(i + m - 1, m - 1, mod, fac);
                ret %= mod;
            }
            out.println(ret);
        }

    }

    static final class MathUtils {
        private MathUtils() {
        }

        public static long quickPow(long a, long b, long mod) {
            long ret = 1, mul = a;
            for (; b > 0; b >>= 1, mul = mul * mul % mod) {
                if ((b & 1) == 1) {
                    ret = ret * mul % mod;
                }
            }
            return ret;
        }

        public static int[] getFactorials(int n, int mod) {
            int[] fac = new int[n + 1];
            fac[0] = 1;
            for (int i = 1; i <= n; i++) {
                fac[i] = (int) ((long) fac[i - 1] * i % mod);
            }
            return fac;
        }

        public static int C(int n, int m, int mod, int[] fac) {
            if (n < m) {
                return 0;
            }
            return (int) (fac[n] % mod * quickPow((long) fac[m] * fac[n - m] % mod, mod - 2, mod) % mod);
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

//Created by Aminul on 4/3/2019.

import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class CF690D2 {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = in.nextInt(), m = in.nextInt();
        initialize(n + m + 10);
        long ans = 0;
        for (int i = 1; i <= m; i++) {
            ans = (ans + nCr(n + i - 1, i)) % mod;
        }
        pw.println(ans);
        pw.close();
    }

    static long f[], inv[], mod = (int) 1e6 + 3;

    static void initialize(int n) {
        f = new long[n + 1];
        f[0] = 1;
        for (int i = 1; i <= n; i++) {
            f[i] = (f[i - 1] * i) % mod;
        }
        inv = new long[n + 1];
        inv[n] = BigInteger.valueOf(f[n]).modInverse(BigInteger.valueOf(mod)).longValue();
        for (int i = n - 1; i >= 0; i--) {
            inv[i] = (inv[i + 1] * (i + 1)) % mod;
        }
    }

    static long nCr(int n, int c) {
        long u = f[n], d = (inv[c] * inv[n - c]) % mod;
        return (u * d) % mod;
    }

    static void debug(Object...obj) {
        System.err.println(Arrays.deepToString(obj));
    }
}

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 *
 * @author pttrung
 */
public class D2_Helvetic_2016 {

	public static long MOD = 1000003;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		int n = in.nextInt();
		int c = in.nextInt();
		long[]p = new long[n + c];
		p[0] = 1;
		for(int i = 1; i < p.length; i++){
			p[i] = (p[i - 1]*(i % MOD) ) % MOD;
		}
		long result = 0;
		for(int i = 1;i <= n; i ++ ){
			long tmp = p[i + c - 1];
			tmp *= pow(p[i], MOD - 2);
			tmp %= MOD;
			tmp *= pow(p[c - 1] , MOD - 2);
			tmp %= MOD;
			result += tmp;
			result %= MOD;
		}
		out.println(result);
		out.close();
	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return Integer.compare(x, o.x);
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}

import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Igor Kraskevich
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD2 solver = new TaskD2();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD2 {

    final long MOD = 1_000_003;

    long binPow(long x, long n) {
        long res = 1;
        while (n > 0) {
            if (n % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            n /= 2;
        }
        return res;
    }

    long inv(long x) {
        return binPow(x, MOD - 2);
    }

    long fac(long n) {
        long res = 1;
        for (int i = 1; i <= n; i++)
            res = res * i % MOD;
        return res;
    }

    public void solve(int testNumber, FastScanner in, PrintWriter out) {
        int n = in.nextInt();
        int k = in.nextInt();
        long res = fac(n + k);
        res = res * inv(fac(k)) % MOD;
        res = res * inv(fac(n)) % MOD;
        out.println((res - 1 + MOD) % MOD);
    }
}

class FastScanner {
    private StringTokenizer tokenizer;
    private BufferedReader reader;

    public FastScanner(InputStream inputStream) {
        reader = new BufferedReader(new InputStreamReader(inputStream));
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            String line = null;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                }
            if (line == null)
                return null;
            tokenizer = new StringTokenizer(line);
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}