{"raw_statement":[{"iden":"problem statement","content":"For strings $S$ and $T$ consisting of lowercase English letters, and a string $X$ consisting of `0` and `1`, define the string $f(S,T,X)$ consisting of lowercase English letters as follows:\n\n*   Starting with an empty string, for each $i=1,2,\\dots,|X|$, append $S$ to the end if the $i$\\-th character of $X$ is `0`, and append $T$ to the end if it is `1`.\n\nYou are given a string $S$ consisting of lowercase English letters, and strings $X$ and $Y$ consisting of `0` and `1`.\nDetermine if there exists a string $T$ (which can be empty) such that $f(S,T,X)=f(S,T,Y)$.\nYou have $t$ test cases to solve."},{"iden":"constraints","content":"*   $1 \\leq t \\leq 5 \\times 10^5$\n*   $1 \\leq |S| \\leq 5\\times 10^5$\n*   $1 \\leq |X|,|Y| \\leq 5\\times 10^5$\n*   $S$ is a string consisting of lowercase English letters.\n*   $X$ and $Y$ are strings consisting of `0` and `1`.\n*   The sum of $|S|$ across all test cases in a single input is at most $5 \\times 10^5$.\n*   The sum of $|X|$ across all test cases in a single input is at most $5 \\times 10^5$.\n*   The sum of $|Y|$ across all test cases in a single input is at most $5 \\times 10^5$."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$t$\n$\\mathrm{case}_1$\n$\\vdots$\n$\\mathrm{case}_t$\n\nEach case is given in the following format:\n\n$S$\n$X$\n$Y$"},{"iden":"sample input 1","content":"3\naraara\n01\n111\naraaaa\n100100\n0010111\nabacabac\n0\n1111"},{"iden":"sample output 1","content":"Yes\nNo\nNo\n\nBelow, string concatenation is represented using $+$.\nFor the 1st test case, if $T=$`ara`, then $f(S,T,X)=S+T=$`araaraara` and $f(S,T,Y)=T+T+T=$`araaraara`, so $f(S,T,X)=f(S,T,Y)$.\nFor the 2nd and 3rd test cases, there is no $T$ that satisfies the condition."},{"iden":"sample input 2","content":"2\nempty\n10101\n00\nempty\n11111\n111"},{"iden":"sample output 2","content":"Yes\nYes\n\n$T$ can be empty."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}