#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define rrep(i, n) for (int i = (int)n-1; i >= 0; --i)
using namespace std;
using ll = long long;
template<typename T>
inline bool chmax(T& a, const T& b) {
    if (a < b){
        a = b;
        return true;
    }
    return false;
}
template<typename T>
inline bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T> auto make_vec(const size_t n, const T &value) {
    return std::vector<T>(n, value);
}
template<typename... Args> auto make_vec(const size_t n, Args... args) {
    return std::vector<decltype(make_vec(args...))>(n, make_vec(args...));
}

template<uint_fast64_t Modulus>
struct modint {
    using u64 = uint_fast64_t;
    u64 a;
    constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
    constexpr u64& value() noexcept { return a; }
    constexpr const u64& value() const noexcept { return a; }
    constexpr modint operator+(const modint rhs) const noexcept {
        return modint(*this) += rhs;
    }
    constexpr modint operator-(const modint rhs) const noexcept {
        return modint(*this) -= rhs;
    }
    constexpr modint operator*(const modint rhs) const noexcept {
        return modint(*this) *= rhs;
    }
    constexpr modint operator/(const modint rhs) const noexcept {
        return modint(*this) /= rhs;
    }
    constexpr modint& operator+=(const modint rhs) noexcept {
        a += rhs.a;
        if (a >= Modulus) a -= Modulus;
        return *this;
    }
    constexpr modint& operator-=(const modint rhs) noexcept {
        if (a < rhs.a) a += Modulus;
        a -= rhs.a;
        return *this;
    }
    constexpr modint& operator*=(const modint rhs) noexcept {
        a = a * rhs.a % Modulus;
        return *this;
    }
    constexpr modint& operator/=(modint rhs) noexcept {
        return *this *= rhs.inv();
    }
    constexpr modint& operator++() noexcept {
        a++;
        if (a = Modulus) a = 0;
        return *this;
    }
    constexpr modint operator++(int) noexcept {
        modint tmp(*this);
        operator++();
        return tmp;
    }
    constexpr modint& operator--() noexcept {
        if (a == 0) a = Modulus;
        a--;
        return *this;
    }
    constexpr modint operator--(int) noexcept {
        modint tmp(*this);
        operator--();
        return tmp;
    }
    constexpr modint pow(u64 exp) const noexcept {
        modint res(1), mul(*this);
        for (; exp; mul *= mul, exp >>= 1) if (exp & 1) res *= mul;
        return res;
    }
    constexpr modint inv() const noexcept {
        return modint(*this).pow(Modulus - 2);
    }
};

using mint = modint<1000000007>;

ostream& operator<<(ostream&os, const mint& obj) { return os << obj.a; }
bool operator==(const mint& lhs, const mint& rhs) { return lhs.a == rhs.a; }
bool operator!=(const mint& lhs, const mint& rhs) { return !(lhs == rhs); }

vector<mint> fact, ifact;
void init(int n) {
    fact.resize(n+1);
    ifact.resize(n+1);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i] * i;
}
mint comb(int n, int k) { return fact[n] * ifact[k] * ifact[n-k]; }
mint perm(int n, int k) { return fact[n] * ifact[n-k]; }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, k;
    cin >> n >> k;
    init(n+k-1);
    cout << comb(n+k-1, n) << endl;
}


Measured memory_bytes: 3248