#include <iostream>
#include <cmath>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e3 + 5;
int fac[N];
int invfac[N];
int ksm(int a, int b) {
int res =1;
for(;b;b>>=1,a=1LL*a*a%mod) if(b&1) res = 1LL*res *a%mod;
return res;
}
void init() {
fac[0] = 1;
for (int i = 1 ; i< N;i++) {
fac[i] = fac[i-1]*1LL*i%mod;
}
invfac[N-1]=ksm(fac[N-1], mod-2);
for(int i = N-1;i>=1;i--)invfac[i-1]=1LL*invfac[i]*i%mod;
}
int C(int i,int j) {
if(i<j) return 0;
return 1LL*fac[i]*invfac[j]%mod*invfac[i-j]%mod;
}
void solve() {
int n, x;
cin >> n >> x;
x = sqrt(x);
cout << C(x, n) << "\n";
}
int main() {
init();
cin.tie(0)->sync_with_stdio(0);
int T = 1;
// cin >> T;
while(T--) solve();
}
// 64 位输出请用 printf("%lld")