{"raw_statement":[{"iden":"problem statement","content":"Snuke is about to make an integer sequence of length $N$ consisting of $0$ and $1$. He starts with an empty sequence $x$ and does the following two kinds of operations $N$ times in total, in any order he likes.\n\n*   Operation A: Flip every element of $x$, that is, convert each $0$ to $1$ and vice versa. Then, add $0$ to the beginning of $x$.\n*   Operation B: Add $0$ to the end of $x$.\n\nYou are given an integer sequence of length $N$ consisting of $0$ and $1$: $A=(A_1,A_2,\\cdots,A_N)$. Determine whether it is possible to make $x$ equal to $A$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq A_i \\leq 1$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\cdots$ $A_N$"},{"iden":"sample input 1","content":"4\n0 1 1 0"},{"iden":"sample output 1","content":"Yes\n\nSnuke can do the following.\n\n*   Start with $x=()$\n*   Do operation A, making $x=(0)$.\n*   Do operation B, making $x=(0,0)$.\n*   Do operation A, making $x=(0,1,1)$.\n*   Do operation B, making $x=(0,1,1,0)$."},{"iden":"sample input 2","content":"4\n1 0 0 0"},{"iden":"sample output 2","content":"No"},{"iden":"sample input 3","content":"4\n0 0 0 1"},{"iden":"sample output 3","content":"No"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}