{"raw_statement":[{"iden":"problem statement","content":"You are given a permutation of $1,2,...,N$: $p_1,p_2,...,p_N$. Determine if the state where $p_i=i$ for every $i$ can be reached by performing the following operation any number of times:\n\n*   Choose three elements $p_{i-1},p_{i},p_{i+1}$ ($2\\leq i\\leq N-1$) such that $p_{i-1}>p_{i}>p_{i+1}$ and reverse the order of these three."},{"iden":"constraints","content":"*   $3 \\leq N \\leq 3 × 10^5$\n*   $p_1,p_2,...,p_N$ is a permutation of $1,2,...,N$."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$p_1$\n$:$\n$p_N$"},{"iden":"sample input 1","content":"5\n5\n2\n1\n4\n3"},{"iden":"sample output 1","content":"Yes\n\nThe state where $p_i=i$ for every $i$ can be reached as follows:\n\n*   Reverse the order of $p_1,p_2,p_3$. The sequence $p$ becomes $1,2,5,4,3$.\n*   Reverse the order of $p_3,p_4,p_5$. The sequence $p$ becomes $1,2,3,4,5$."},{"iden":"sample input 2","content":"4\n3\n2\n4\n1"},{"iden":"sample output 2","content":"No"},{"iden":"sample input 3","content":"7\n3\n2\n1\n6\n5\n4\n7"},{"iden":"sample output 3","content":"Yes"},{"iden":"sample input 4","content":"6\n5\n3\n4\n1\n2\n6"},{"iden":"sample output 4","content":"No"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}