spoj#COPSEQH. Non Coprime Sequences(Hard)
Non Coprime Sequences(Hard)
Define F(n,m) to be the number of sequences of length n which satisfy:
- All elements of the sequence are positive divisors of m
- For any two adjacent elements, say p and q, there exists at least one prime which divides both of them.
You are given two integers, n and m. Find the values of F(1,m), F(2,m), ... ,F(n,m) modulo 109+7
Input
The only line of input contains two integers, n and m.
Constraints
- 0 < n ≤ 105
- 0 < m ≤ 1018
Output
Print the values of F(1,m), F(2,m), ... , F(n,m) modulo 109+7 in a single line separated by space.
Example
Input: 2 10</p>Output: 4 7
Print the number of such sequences modulo 10^9 + 7