{"raw_statement":[{"iden":"problem statement","content":"Given a sequence $A$ of $N$ numbers, answer the following $Q$ questions.\n\n*   In the $i$\\-th question, you are given integers $L_i$ and $R_i$. Is $A_{L_i} \\times A_{L_i+1} \\times \\dots \\times A_{R_i}$ a cubic number?\n\nHere, a positive integer $x$ is said to be a cubic number when there is a positive integer $y$ such that $x=y^3$."},{"iden":"constraints","content":"*   All values in input are integers.\n*   $1 \\le N,Q \\le 2 \\times 10^5$\n*   $1 \\le A_i \\le 10^6$\n*   $1 \\le L_i \\le R_i \\le N$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $Q$\n$A_1$ $A_2$ $\\dots$ $A_N$\n$L_1$ $R_1$\n$L_2$ $R_2$\n$\\vdots$\n$L_Q$ $R_Q$"},{"iden":"sample input 1","content":"8 5\n7 49 30 1 15 8 6 10\n1 2\n2 3\n4 4\n5 8\n3 8"},{"iden":"sample output 1","content":"Yes\nNo\nYes\nNo\nYes\n\n*   For the first question, $7 \\times 49 = 343$ is a cubic number.\n*   For the second question, $49 \\times 30 = 1470$ is not a cubic number.\n*   For the third question, $1$ is a cubic number.\n*   For the fourth question, $15 \\times 8 \\times 6 \\times 10 = 7200$ is not a cubic number.\n*   For the fifth question, $30 \\times 1 \\times 15 \\times 8 \\times 6 \\times 10 = 216000$ is a cubic number."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}