#include <bits/stdc++.h>
using namespace std;
namespace modular_space {
	long long mod;
	struct umod {
		long long val;
		umod(): val(0ll){}
		umod(long long x){ x %= mod; if(x < 0) x += mod; val = x; }
		umod& operator += (umod oth){ val += oth.val; if(val >= mod) val -= mod; return *this; }
		umod& operator -= (umod oth){ val -= oth.val; if(val < 0) val += mod; return *this; }
		umod& operator *= (umod oth){ val = val * oth.val % mod; return *this; }
		umod& operator /= (umod oth){ return *this *= oth.inverse(); }
		umod& operator ^= (long long oth){ return *this = pwr(*this, oth); }
		umod operator + (umod oth) const { return umod(*this) += oth; }
	       	umod operator - (umod oth) const { return umod(*this) -= oth; }
		umod operator * (umod oth) const { return umod(*this) *= oth; }
		umod operator / (umod oth) const { return umod(*this) /= oth; }
		umod operator ^ (long long oth) const { return umod(*this) ^= oth; }
		bool operator < (umod oth) const { return val < oth.val; }
		bool operator > (umod oth) const { return val > oth.val; }
		bool operator <= (umod oth) const { return val <= oth.val; }
		bool operator >= (umod oth) const { return val >= oth.val; }
		bool operator == (umod oth) const { return val == oth.val; }
		bool operator != (umod oth) const { return val != oth.val; }
		umod pwr(umod a, long long b) const {
			umod r = 1;
			for(; b; a *= a, b >>= 1)
				if(b&1)
					r *= a;
			return r;
		}
		umod inverse() const {
			long long a = val, b = mod, u = 1, v = 0;
			while(b){
				long long t = a/b;
				a -= t * b; swap(a, b);
				u -= t * v; swap(u, v);
			}
			if(u < 0)
				u += mod;
			return u;
		}
		friend istream& operator >> (istream &is, umod &oth);
		friend ostream& operator << (ostream &os, const umod& oth);
	};
	ostream& operator << (ostream &os, const umod &oth){
		os << oth.val;
		return os;
	}
	istream& operator >> (istream &is, umod &oth){
		long long x; is >> x;
		oth = umod(x);
		return is;
	}
	struct binprime_kit {
		int sz;
		vector<umod> fat, ifat;
		void init(int s){
			sz = s;
			fat.resize(sz + 1);
			ifat.resize(sz + 1);
			fat[0] = 1;
			for(int i = 1; i <= sz; i++) fat[i] = fat[i - 1] * i;
			ifat[sz] = fat[sz] ^ (mod - 2);
			for(int i = sz - 1; i >= 0; i--) ifat[i] = ifat[i + 1] * (i + 1);
		}
		umod coef(int n, int r){
			if(n < r) return 0;
			return fat[n] / (ifat[r] * ifat[n - r]);
		}
	};
};
const int maxn = 2222;
using U = modular_space::umod;
U f[maxn][maxn], coef[maxn][maxn], pref_coef[maxn][maxn]; bool seen[maxn][maxn];
U solve(int a, int b){
	if(a == 0 || b == 0) return 1;
	if(seen[a][b]) return f[a][b];
	seen[a][b] = 1;
	U ans = solve(a - 1, b);
	int na = a, nb = b - 1;
	ans += pref_coef[nb][min(na, nb)];
	return f[a][b] = ans;
}
int main(){
	modular_space::mod = 1'000'000'007;
	for(int i = 0; i < maxn; i++){
		coef[i][0] = coef[i][i] = 1;
		for(int j = 1; j < i; j++)
			coef[i][j] = coef[i - 1][j] + coef[i - 1][j - 1];
		pref_coef[i][0] = coef[i][0];
		for(int j = 0; j < i; j++)
			pref_coef[i][j + 1] = pref_coef[i][j] + coef[i][j + 1];
	}
	int red, blue; cin >> red >> blue;
	U ans = 0;
	for(int i = 0; i <= red; i++){
		int nr = red - i, nb = blue - 1;
		for(int j = 0; j <= nb; j++) if((nb - j <= nr)) {
			ans += coef[nb][j] * solve(nr - (nb - j), nb - j);
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 120832