{"problem":{"name":"LRU Puzzle","description":{"content":"There are $N$ arrays. The length of each array is $M$ and initially each array contains integers $(1，2，...，M)$ in this order. Mr. Takahashi has decided to perform $Q$ operations on those $N$ arrays. F","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"codefestival_2016_qualA_e"},"statements":[{"statement_type":"Markdown","content":"There are $N$ arrays. The length of each array is $M$ and initially each array contains integers $(1，2，...，M)$ in this order.\nMr. Takahashi has decided to perform $Q$ operations on those $N$ arrays. For the $i$\\-th ($1≤i≤Q$) time, he performs the following operation.\n\n*   Choose an arbitrary array from the $N$ arrays and move the integer $a_i$ ($1≤a_i≤M$) to the front of that array. For example, after performing the operation on $a_i=2$ and the array $(5，4，3，2，1)$, this array becomes $(2，5，4，3，1)$.\n\nMr. Takahashi wants to make $N$ arrays exactly the same after performing the $Q$ operations. Determine if it is possible or not.\n\n## Constraints\n\n*   $2≤N≤10^5$\n*   $2≤M≤10^5$\n*   $1≤Q≤10^5$\n*   $1≤a_i≤M$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$\n$Q$\n$a_1$ $a_2$ $...$ $a_Q$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"codefestival_2016_qualA_e","tags":[],"sample_group":[["2 2\n3\n2 1 2","Yes\n\nYou can perform the operations as follows.\n![image](/img/other/code_festival_2016_quala/gbanjthabot/E_0.png)"],["3 2\n3\n2 1 2","No"],["2 3\n3\n3 2 1","Yes\n\nYou can perform the operations as follows.\n![image](/img/other/code_festival_2016_quala/gbanjthabot/E_2.png)"],["3 3\n6\n1 2 2 3 3 3","No"]],"created_at":"2026-03-03 11:01:13"}}