import
java.math.BigInteger;
public
class
Main
{
private
static
final
BigInteger MOD = BigInteger.valueOf(
1000000000
+
7
);
private
static
BigInteger gcd(BigInteger a, BigInteger b) {
if
(a.equals(BigInteger.ZERO)) {
return
b;
}
return
gcd(b.mod(a), a);
}
private
static
BigInteger power(BigInteger x, BigInteger y, BigInteger M) {
if
(y.equals(BigInteger.ZERO)) {
return
BigInteger.ONE;
}
BigInteger p = power(x, y.divide(BigInteger.TWO), M).mod(M);
p = p.multiply(p).mod(M);
return
y.mod(BigInteger.TWO).equals(BigInteger.ZERO) ? p : x.multiply(p).mod(M);
}
private
static
BigInteger modInverse(BigInteger A, BigInteger M) {
BigInteger g = gcd(A, M);
return
power(A, M.subtract(BigInteger.TWO), M);
}
private
static
BigInteger countWays(BigInteger A, BigInteger K)
{
BigInteger[] fact =
new
BigInteger[
100001
];
fact[
1
] = BigInteger.ONE;
for
(
int
i =
2
; i <=
100000
; i++) {
fact[i] = fact[i -
1
].multiply(BigInteger.valueOf(i)).mod(MOD);
}
BigInteger ans = fact[A.intValue() + K.intValue()].multiply(modInverse(fact[A.intValue() -
1
], MOD)).mod(MOD);
ans = ans.multiply(modInverse(fact[K.intValue() +
1
], MOD)).mod(MOD);
return
ans;
}
public
static
void
main(String[] args) {
BigInteger A = BigInteger.valueOf(
2
);
BigInteger K = BigInteger.valueOf(
2
);
System.out.println(countWays(A, K));
BigInteger A1 = BigInteger.valueOf(
3
);
BigInteger K1 = BigInteger.valueOf(
3
);
System.out.println(countWays(A1, K1));
}
}