#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <tuple>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
const int INF = 1000000000;
const int MOD = 1000000007;

const long long MAX = 1000100;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for(int i = 2;i < MAX;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;
	}
}
long long 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(){
	COMinit();
	int n,m;
	cin >> n >> m;

	map<int,int> mp;
	for(int i = 2;i * i <= m;i++){
		while(m % i == 0){
			mp[i]++;
			m /= i;
		}
	}

	if(m != 1)mp[m]++;

	ll ans = 1;

	for(auto p:mp){
		ll com = COM(p.second+n-1,p.second);
		ans *= com;
		ans %= MOD;
	}

	cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;


int main() {
    int A,B; cin >> A >> B; // Aが白

    bool changed = false;
    if (A>B){
        swap(A,B);
        changed = true;
    }

    vector<vector<int>> T(100,vector<int>(100,0));

    
    int b = 1;
    while(b<=B){
        int yoko = (b-1)%25;
        yoko *= 4;
        int tate = (b-1)/25;
        tate *= 4;

        T[tate][yoko] = 1;
        T[tate][yoko+1] = 1;
        T[tate][yoko+2] = 1;
        T[tate+1][yoko] = 1;
        T[tate+1][yoko+1] = 1;
        T[tate+1][yoko+2] = 1;
        T[tate+2][yoko] = 1;
        T[tate+2][yoko+1] = 1;
        T[tate+2][yoko+2] = 1;    

        b++;
    }

    int a = 1;
    while(a<=A-1){
        int yoko = (a-1)%25;
        yoko *= 4;
        int tate = (a-1)/25;
        tate *= 4;

        
        T[tate+1][yoko+1] = 0;   

        a++;
    }

    cout << 100 << " " << 100 << endl;
    REP(i,100){
        REP(j,100){
            if(!changed){
                if(T[i][j]==0)cout << ".";
                else cout << "#";
            }else{
                if(T[i][j]==0)cout << "#";
                else cout << ".";
            }
            
        }
        cout << endl;
    }

    


    return 0;
}