typedef long long LL;
const int N = 5e5 + 10;
const LL mod = 1e9 + 7;
LL A[N], B[N];
void Init()
{
A[0] = 1;
for(int i = 1; i < N; i++){
A[i] = A[i - 1] * i % mod;
}
}
LL Ext_Gcd(LL a, LL b, LL &x, LL &y)
{
if(!b){
x = 1; y = 0;
return a;
}
LL d = Ext_Gcd(b, a % b, y, x);
y -= a / b * x;
return d;
}
LL Inv(LL a, LL n)
{
LL x, y;
LL d = Ext_Gcd(a, n, x, y);
if(d == 1)return (x % n + n) % n;
return -1;
}
LL get()
{
for(int i = 0;i < N; i++)
B[i] = Inv(A[i], mod);
}
LL C(LL a, LL b, LL mod)
{
if(a < b)return 0;
return (A[a] * B[b] % mod) * B[a - b] % mod;
}