시간 제한메모리 제한제출정답맞힌 사람정답 비율
2.5 초 256 MB5111919.149%

문제

Let us fix an integer $m$. Consider an array $a$ consisting of $n$ positive integers. The array $a$ is fancy if each number in $a$ is a divisor of $m$, and each two neighboring numbers in $a$ are not coprime.

Find the total number of fancy arrays of length $n$. As the answer may be large, find it modulo $10^{9} + 7$.

입력

The first line contains two integers, $m$ and $q$: the number introduced above and the number of queries ($1 \le m \le 10^{16}$, $1 \le q \le 150$). 

Each of the next $q$ lines contains a single integer $n$ ($1 \le n \le 10^{18}$).

출력

For each query, print the number of fancy arrays for the given $m$ and $n$ modulo $10^{9} + 7$.

예제 입력 1

12 3
1
2
3

예제 출력 1

6
21
91