{"raw_statement":[{"iden":"problem statement","content":"A sequence of positive integers $T=(T_1,T_2,\\dots,T_M)$ of length $M$ is a **palindrome** if and only if $T_i=T_{M-i+1}$ for each $i=1,2,\\dots,M$.\nYou are given a sequence of non-negative integers $A = (A_1,A_2,\\dots,A_N)$ of length $N$. Determine if there is a sequence of positive integers $S=(S_1,S_2,\\dots,S_N)$ of length $N$ that satisfies the following condition, and if it exists, find the lexicographically smallest such sequence.\n\n*   For each $i=1,2,\\dots,N$, both of the following hold:\n    *   The sequence $(S_{i-A_i},S_{i-A_i+1},\\dots,S_{i+A_i})$ is a palindrome.\n    *   If $2 \\leq i-A_i$ and $i+A_i \\leq N-1$, the sequence $(S_{i-A_i-1},S_{i-A_i},\\dots,S_{i+A_i+1})$ is not a palindrome."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq A_i \\leq \\min{i-1,N-i}$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$"},{"iden":"sample input 1","content":"7\n0 0 2 0 2 0 0"},{"iden":"sample output 1","content":"Yes\n1 1 2 1 1 1 2\n\n$S = (1,1,2,1,1,1,2)$ satisfies the condition:\n\n*   $i=1$: $(A_1)=(1)$ is a palindrome.\n*   $i=2$: $(A_2)=(1)$ is a palindrome, but $(A_1,A_2,A_3)=(1,1,2)$ is not.\n*   $i=3$: $(A_1,A_2,\\dots,A_5)=(1,1,2,1,1)$ is a palindrome.\n*   $i=4$: $(A_4)=(1)$ is a palindrome, but $(A_3,A_4,A_5)=(2,1,1)$ is not.\n*   $i=5$: $(A_3,A_4,\\dots,A_7)=(2,1,1,1,2)$ is a palindrome.\n*   $i=6$: $(A_6)=(1)$ is a palindrome, but $(A_5,A_6,A_7)=(1,1,2)$ is not.\n*   $i=7$: $(A_7)=(2)$ is a palindrome.\n\nThere are other sequences like $S=(2,2,1,2,2,2,1)$ that satisfy the condition, but print the lexicographically smallest one, which is $(1,1,2,1,1,1,2)$."},{"iden":"sample input 2","content":"7\n0 1 2 3 2 1 0"},{"iden":"sample output 2","content":"Yes\n1 1 1 1 1 1 1"},{"iden":"sample input 3","content":"7\n0 1 2 0 2 1 0"},{"iden":"sample output 3","content":"No"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}