{"raw_statement":[{"iden":"problem statement","content":"You are given a positive integer $N$ and a sequence $A=(A_1,A_2,\\dots,A_N)$ of length $N$, consisting of $0$ and $1$.\nWe call a string $S$ of length $N$, consisting only of uppercase English letters, a **good string** if it is possible to perform the following operation any number of times (possibly zero) so that the sequence $A$ contains no $0$. Here, $S_i$ $(1\\leq i\\leq N)$ denotes the $i$\\-th character of $S$, and we define $S_{N+1}=S_1$, $S_{N+2}=S_2$, and $A_{N+1}=A_1$.\n\n*   Perform one of the following operations:\n    *   Choose an integer $i$ with $1\\leq i\\leq N$ such that $S_i=$ `A`, $S_{i+1}=$ `R`, and $S_{i+2}=$ `C`, and replace each of $A_i$ and $A_{i+1}$ with $1$.\n    *   Choose an integer $i$ with $1\\leq i\\leq N$ such that $S_{i+2}=$ `A`, $S_{i+1}=$ `R`, and $S_i=$ `C`, and replace each of $A_i$ and $A_{i+1}$ with $1$.\n\nDetermine whether there exists a good string."},{"iden":"constraints","content":"*   $3\\leq N\\leq 200000$\n*   $A_i\\in \\lbrace 0,1 \\rbrace$ $(1\\leq i\\leq N)$\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":"12\n0 1 0 1 1 1 1 0 1 1 1 0"},{"iden":"sample output 1","content":"Yes\n\nFor example, `RARCARCCRAGC` is a good string. This is because it is possible to change all elements of $A$ to $1$ by performing the following operations:\n\n*   Initially, $A=(0,1,0,1,1,1,1,0,1,1,1,0)$.\n*   Perform the first operation with $i=2$. Then, $A=(0,1,1,1,1,1,1,0,1,1,1,0)$.\n*   Perform the first operation with $i=5$. Then, $A=(0,1,1,1,1,1,1,0,1,1,1,0)$.\n*   Perform the second operation with $i=8$. Then, $A=(0,1,1,1,1,1,1,1,1,1,1,0)$.\n*   Perform the second operation with $i=12$. Then, $A=(1,1,1,1,1,1,1,1,1,1,1,1)$.\n\nSince there exists a good string, output `Yes`."},{"iden":"sample input 2","content":"3\n0 0 0"},{"iden":"sample output 2","content":"No\n\nGood strings do not exist."},{"iden":"sample input 3","content":"29\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},{"iden":"sample output 3","content":"Yes\n\nSince $A$ already contains no $0$, every string of length $29$ consisting of uppercase English letters is a good string."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}