LL quick_pow(LL a, LL n){
LL ans = 1LL;
a %= p;
while
(n){
if
(n & 1) ans = ans * a % p;
a = a * a % p;
n >>= 1;
}
return
ans;
}
LL C(LL n, LL m){
if
(n < m)
return
0;
LL a = 1LL, b = 1LL;
while
(m){
a = a * n % p;
b = b * m % p;
--n; --m;
}
return
a * quick_pow(b, p-2) % p;
}
LL Lucas(LL n, LL m){
if
(!m)
return
1;
return
C(n%p, m%p) * Lucas(n/p, m/p) % p;
}