{"raw_statement":[{"iden":"statement","content":"Seyyed and MoJaK are friends of Sajjad. Sajjad likes a permutation. Seyyed wants to change the permutation in a way that Sajjad won't like it. Seyyed thinks more swaps yield more probability to do that, so he makes MoJaK to perform a swap between every pair of positions (_i_, _j_), where _i_ < _j_, exactly once. MoJaK doesn't like to upset Sajjad.\n\nGiven the permutation, determine whether it is possible to swap all pairs of positions so that the permutation stays the same. If it is possible find how to do that."},{"iden":"input","content":"The first line contains single integer _n_ (1 ≤ _n_ ≤ 1000) — the size of the permutation.\n\nAs the permutation is not important, you can consider _a__i_ = _i_, where the permutation is _a_1, _a_2, ..., _a__n_."},{"iden":"output","content":"If it is not possible to swap all pairs of positions so that the permutation stays the same, print \"_NO_\",\n\nOtherwise print \"_YES_\", then print lines: the _i_\\-th of these lines should contain two integers _a_ and _b_ (_a_ < _b_) — the positions where the _i_\\-th swap is performed."},{"iden":"examples","content":"Input\n\n3\n\nOutput\n\nNO\n\nInput\n\n1\n\nOutput\n\nYES"}],"translated_statement":[{"iden":"statement","content":"Seyyed 和 MoJaK 是 Sajjad 的朋友。Sajjad 喜欢一个排列。Seyyed 希望通过某种方式改变这个排列，使得 Sajjad 不再喜欢它。Seyyed 认为交换次数越多，成功改变排列的概率就越大，因此他让 MoJaK 对每一对位置 #cf_span[(i, j)]（其中 #cf_span[i < j]）恰好执行一次交换。但 MoJaK 不想让 Sajjad 不开心。\n\n给定一个排列，请判断是否可能通过执行所有位置对的交换，使得排列最终保持不变。如果可能，请给出一种具体的交换方案。\n\n第一行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 1000]）——排列的大小。\n\n由于排列本身不重要，你可以假设 #cf_span[ai = i]，即排列为 #cf_span[a1, a2, ..., an]。\n\n如果不可能通过执行所有位置对的交换使排列保持不变，请输出 \"_NO_\"；\n\n否则输出 \"_YES_\"，然后输出 #cf_span[\\binom{n}{2}] 行：第 #cf_span[i] 行应包含两个整数 #cf_span[a] 和 #cf_span[b]（#cf_span[a < b]），表示第 #cf_span[i] 次交换发生在位置 #cf_span[a] 和 #cf_span[b] 上。"},{"iden":"input","content":"第一行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 1000]）——排列的大小。由于排列本身不重要，你可以假设 #cf_span[ai = i]，即排列为 #cf_span[a1, a2, ..., an]。"},{"iden":"output","content":"如果不可能通过执行所有位置对的交换使排列保持不变，请输出 \"_NO_\"；否则输出 \"_YES_\"，然后输出 #cf_span[\\binom{n}{2}] 行：第 #cf_span[i] 行应包含两个整数 #cf_span[a] 和 #cf_span[b]（#cf_span[a < b]），表示第 #cf_span[i] 次交换发生在位置 #cf_span[a] 和 #cf_span[b] 上。"},{"iden":"examples","content":"输入\n3\n输出\nNO\n\n输入\n1\n输出\nYES"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $, $ n \\geq 1 $.  \nLet $ \\sigma \\in S_n $ be the identity permutation: $ \\sigma(i) = i $ for all $ i \\in \\{1, \\dots, n\\} $.  \nLet $ \\mathcal{P} = \\{ (i,j) \\mid 1 \\leq i < j \\leq n \\} $ be the set of all unordered pairs of distinct indices.  \n\n**Constraints**  \n1. $ 1 \\leq n \\leq 1000 $  \n2. Each pair $ (i,j) \\in \\mathcal{P} $ is swapped **exactly once**, in some order.  \n\n**Objective**  \nDetermine whether there exists an ordering of the swaps $ (i_1, j_1), (i_2, j_2), \\dots, (i_m, j_m) $, where $ m = \\binom{n}{2} $, such that the composition of these transpositions leaves $ \\sigma $ unchanged.  \n\nThat is, let $ \\tau_1, \\tau_2, \\dots, \\tau_m $ be the transpositions corresponding to the swaps.  \nWe require:  \n$$\n\\tau_m \\circ \\tau_{m-1} \\circ \\cdots \\circ \\tau_1 \\circ \\sigma = \\sigma\n$$  \nEquivalently, the product of all transpositions must be the identity permutation:  \n$$\n\\prod_{(i,j) \\in \\mathcal{P}} (i\\;j) = \\mathrm{id}\n$$  \n\n**Note**: The product of all transpositions in $ S_n $ is the identity **if and only if** $ n \\equiv 0 \\pmod{4} $ or $ n \\equiv 1 \\pmod{4} $.  \n\nThus:  \n- If $ n \\equiv 2 \\pmod{4} $ or $ n \\equiv 3 \\pmod{4} $, output \"_NO_\".  \n- Otherwise, output \"_YES_\" and list all pairs $ (i,j) $ with $ i < j $ in any order.","simple_statement":null,"has_page_source":false}