{"problem":{"name":"01 Generation","description":{"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","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc138_b"},"statements":[{"statement_type":"Markdown","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$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq A_i \\leq 1$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\cdots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc138_b","tags":[],"sample_group":[["4\n0 1 1 0","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)$."],["4\n1 0 0 0","No"],["4\n0 0 0 1","No"]],"created_at":"2026-03-03 11:01:13"}}