Let rad$$$(n)$$$ denote the product of all distinct prime divisors of the number $$$n$$$. For example, rad$$$(504)$$$ = rad$$$(2^3 \cdot 3^2 \cdot 7)$$$ $$$= 2 \cdot 3 \cdot 7$$$ $$$=42$$$. We define rad$$$(1) = 1$$$.
The statement of this problem is simple: you have an array $$$a$$$ of size $$$n$$$. You are given $$$q$$$ queries $$$[\ell;r]$$$, and you need to compute rad of the product of the numbers $$$a_\ell, a_{\ell + 1}, \dots, a_r$$$, that is: $$$$$$\displaystyle\texttt{rad}\left(\prod_{i=\ell}^{r} a_i\right) = \texttt{rad}\left(a_\ell \times a_{\ell + 1} \times \dots \times a_r \right)$$$$$$ Since this number can be quite large, output it modulo $$$10^9 + 7$$$.
The first line of input contains two numbers $$$n,q$$$ ($$$1 \le n,q \le 5 \cdot 10^5$$$), the number of elements in the array and the number of queries.
The second line of input contains $$$n$$$ numbers $$$a_i$$$ ($$$1 \le a_i \le 2 \cdot 10^5$$$), the array $$$a$$$.
In the following $$$q$$$ lines, two numbers $$$\ell, r$$$ ($$$1 \le \ell \le r \le n$$$) are given, which are the boundaries of the next query.
In $$$q$$$ lines of output, print one number per line, the answer to the problem modulo $$$10^9 + 7$$$.
| № | Additional Constraints | Points | Req. Groups | Comment | ||
| $$$n$$$ | $$$q$$$ | $$$a_i$$$ | ||||
| $$$0$$$ | — | — | — | — | — | Tests from the statement |
| $$$1$$$ | $$$n \le 100$$$ | $$$q \le 100$$$ | $$$a_i \le 100$$$ | $$$8$$$ | $$$0$$$ | — |
| $$$2$$$ | — | $$$9$$$ | $$$1$$$ | — | ||
| $$$3$$$ | $$$n \le 1000$$$ | $$$q \le 1000$$$ | $$$a_i \le 1000$$$ | $$$10$$$ | $$$1$$$ | — |
| $$$4$$$ | — | $$$11$$$ | $$$1-3$$$ | — | ||
| $$$5$$$ | — | — | — | $$$11$$$ | — | All $$$a_i$$$ are prime and distinct |
| $$$6$$$ | — | — | $$$a_i \le 300$$$ | $$$12$$$ | $$$0-2$$$ | — |
| $$$7$$$ | $$$n \le 5 \cdot 10^4$$$ | $$$q \le 5 \cdot 10^4$$$ | — | $$$7$$$ | $$$0,1,3$$$ | — |
| $$$8$$$ | $$$n \le 10^5$$$ | $$$q \le 10^5$$$ | — | $$$4$$$ | $$$7$$$ | — |
| $$$9$$$ | $$$n \le 2 \cdot 10^5$$$ | $$$q \le 2 \cdot 10^5$$$ | — | $$$4$$$ | $$$8$$$ | — |
| $$$10$$$ | $$$n \le 3 \cdot 10^5$$$ | $$$q \le 3 \cdot 10^5$$$ | — | $$$3$$$ | $$$9$$$ | — |
| $$$11$$$ | $$$n \le 4 \cdot 10^5$$$ | $$$q \le 4 \cdot 10^5$$$ | — | $$$2$$$ | $$$10$$$ | — |
| $$$12$$$ | — | — | — | $$$7$$$ | $$$5$$$ | All $$$a_i$$$ are prime |
| $$$13$$$ | — | — | — | $$$12$$$ | $$$0-12$$$ | — |
5 642 35 11 26 131 32 43 51 52 24 5
2310 10010 286 30030 35 26
2 12 21 2
2
| Name |
|---|


