#include using namespace std; int id[1500][1500], dp[1500][1500]; int main() { int n, x; cin >> n >> x; ++x; if (n > 30 || x < 1 << n) { printf("0\n"); return 0; } vector yak; for (int i = 1; i * (long long)i <= x; i++) { if (x % i == 0) { yak.emplace_back(i); if (x / i > i) yak.emplace_back(x / i); } } sort(yak.begin(), yak.end()); int c = yak.size(); unordered_map m; for (int i = 0; i < c; i++) { m[yak[i]] = i; for (int j = 0; j <= i; j++) id[i][j] = yak[i] % yak[j] > 0 ? 0 : m[yak[i] / yak[j]]; } for (int i = 1; i < c; i++) for (int j = i; j < c; j++) dp[i][j] = 1; for (int i = 0; i < n - 1; i++) for (int j = c - 1; j > 0; j--) for (int k = 1; k < c; k++) dp[j][k] = dp[j][k - 1] + dp[id[j][k]][k]; cout << dp[c - 1][c - 1] << "\n"; return 0; }