{"raw_statement":[{"iden":"problem statement","content":"Given are a prime number $P$ and positive integers $a$ and $b$. Determine whether there is a sequence of $P$ integers, $A = (A_1, A_2, \\ldots, A_P)$, satisfying all of the conditions below, and print one such sequence if it exists.\n\n*   $1\\leq A_i\\leq P - 1$.\n*   $A_1 = A_P = 1$.\n*   $(A_1, A_2, \\ldots, A_{P-1})$ is a permutation of $(1, 2, \\ldots, P-1)$.\n*   For every $2\\leq i\\leq P$, at least one of the following holds.\n    *   $A_{i} \\equiv aA_{i-1}\\pmod{P}$\n    *   $A_{i-1} \\equiv aA_{i}\\pmod{P}$\n    *   $A_{i} \\equiv bA_{i-1}\\pmod{P}$\n    *   $A_{i-1} \\equiv bA_{i}\\pmod{P}$"},{"iden":"constraints","content":"*   $2\\leq P\\leq 10^5$\n*   $P$ is a prime.\n*   $1\\leq a, b \\leq P - 1$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$P$ $a$ $b$"},{"iden":"sample input 1","content":"13 4 5"},{"iden":"sample output 1","content":"Yes\n1 5 11 3 12 9 7 4 6 8 2 10 1\n\nThis sequence satisfies the conditions, since we have the following modulo $P = 13$:\n\n*   $A_2\\equiv 5A_1$\n*   $A_2\\equiv 4A_3$\n*   $\\vdots$\n*   $A_{13}\\equiv 4A_{12}$"},{"iden":"sample input 2","content":"13 1 2"},{"iden":"sample output 2","content":"Yes\n1 2 4 8 3 6 12 11 9 5 10 7 1"},{"iden":"sample input 3","content":"13 9 3"},{"iden":"sample output 3","content":"No"},{"iden":"sample input 4","content":"13 1 1"},{"iden":"sample output 4","content":"No"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}