{"raw_statement":[{"iden":"problem statement","content":"There is a sequence $A = (A_1,\\dots,A_N)$. Determine whether there are at least two subsequences of $A$ that match the sequence $B = (B_1,\\dots,B_M)$. Two subsequences are distinguished if they are taken from different positions, even if they coincide as sequences.\nSubsequence A subsequence of $A$ is a sequence obtained by removing zero or more elements from $A$ and leaving the remaining elements in their original order."},{"iden":"constraints","content":"*   $1 \\leq M \\leq N \\leq 2\\times 10^5$\n*   $1 \\leq A_i \\leq 10^9$\n*   $1 \\leq B_i \\leq 10^9$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n$B_1$ $B_2$ $\\ldots$ $B_M$"},{"iden":"sample input 1","content":"4 2\n1 2 1 2\n1 2"},{"iden":"sample output 1","content":"Yes\n\nThere are three subsequences of $A$ that match $B$: $(A_1,A_2), (A_1,A_4), (A_3,A_4)$."},{"iden":"sample input 2","content":"3 2\n1 2 1\n1 2"},{"iden":"sample output 2","content":"No\n\nThere is only one subsequence of $A$ that matches $B$: $(A_1,A_2)$."},{"iden":"sample input 3","content":"3 2\n1 1 2\n2 1"},{"iden":"sample output 3","content":"No\n\nThere are no subsequences of $A$ that match $B$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}