https://paiza.io/projects/5hnvcejbjkeHRGcZijUIpw
process.stdin.resume();
process.stdin.setEncoding('utf8');
const calc = (N, M, cache) => {
if (cache[M]) return cache[M];
let count = BigInt(0);
for (let i = N; i > 1; --i) {
if (M > 1) {
count += BigInt(N - 1);
}
const newM = M - i - 1
count += (newM > 0) ? calc(N, newM, cache) : BigInt(1);
}
count += (M > 1) ? calc(N, M - 1, cache) : BigInt(1);
cache[M] = count;
return count;
};
const data = [];
const reader = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
reader.on('line', (line) => {
data.push(line);
});
reader.on('close', () => {
const N = Number(data[0]);
console.log(Number(calc(N, N, new Array(N)) % BigInt(10**9 + 7)));
reader.close();
process.exit();
});
// 用を思い出したので起きて片付けてたのですが、ついでにpaizaに貼っときました。遅くて6桁とか全然…