#import <Foundation/Foundation.h>
#define MOD 1000000007LL
#define MAXSIZE 2000000LL

typedef long long INT;

@interface NSNumber (Extension)
-(NSMutableArray*)primeFactors;
@end

@implementation NSNumber (Extension)
-(NSMutableArray*)primeFactors
{
	NSMutableArray *array = [NSMutableArray array];
	INT factor = 0;
	INT factorCount = 0;
	INT n = [self longLongValue];
	INT q = n;
	
	if (n == 1) {
		return [NSMutableArray arrayWithArray: @[@{@"factor": @1, @"exponent": @1}]];
	}
	for(INT i=2;i*i<=n;){
		if (q % i == 0) {
			if (i != factor) {
				factor = i;
				factorCount = 1;
			} else {
				factorCount++;
			}
			q /= i;
		} else {
			if (factor > 0) {
				[array addObject: @{@"factor": @(factor), @"exponent": @(factorCount)}];
				factor = 0;
			}
			i++;
		}
	}
	if (q > 1) {
		[array addObject: @{@"factor": @(q), @"exponent": @1}];
	}
	return array;
}
@end

INT fac[MAXSIZE], finv[MAXSIZE], inv[MAXSIZE];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (INT i = 2; i < MAXSIZE; i++){
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
INT COM(INT n, INT k){
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
	@autoreleasepool {
		COMinit();

		INT N,M;
		scanf("%lld %lld",&N,&M);
		if (M==1) {
			puts("1");
			return 0;
		}
		NSArray *primeFactors = [@(M) primeFactors];
		INT ans = 1;
		for (NSDictionary *factor in primeFactors){
			INT e = [[factor objectForKey:@"exponent"] longLongValue];
			INT c = COM(e+N-1,N-1);
			ans *= c % MOD;
			ans %= MOD;
		}
		printf("%lld",ans);
	}
}
