#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
//#define debug
using ll = long long;
const ll M = 1e9 + 7;
void solve()
{
    vector<vector<ll>> a(2000,vector<ll>(2000,0));
    int x, y;
    cin >> x >> y;
    for (int i = 1; i <= x;i++)
    {
        for (int j = 1; j <= y;j++)
        {
            if(i==1||j==1)
            {
                a[i][j] = 1;
            }
            else
            {
                a[i][j] = (a[i - 1][j] + a[i][j - 1])%M;
            }
            
        }
    }
    cout << a[x][y];
    return;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n=1;
    while(n--)
        solve();
    return 0;
}