Takahashi's Failure

AtCoder
IDabc252_b
Time2000ms
Memory256MB
Difficulty
Takahashi has $N$ foods in his house. The $i$\-th food has the tastiness of $A_i$. He dislikes $K$ of these foods: for each $i=1,2,\ldots,K$, he dislikes the $B_i$\-th food. Out of the foods with the greatest tastiness among the $N$ foods, Takahashi will randomly choose one and eat it. If he has a chance to eat something he dislikes, print `Yes`; otherwise, print `No`. ## Constraints * $1\leq K\leq N\leq 100$ * $1\leq A_i\leq 100$ * $1\leq B_i\leq N$ * All $B_i$ are distinct. * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $K$ $A_1$ $A_2$ $\ldots$ $A_N$ $B_1$ $B_2$ $\ldots$ $B_K$ [samples]
Samples
Input #1
5 3
6 8 10 7 10
2 3 4
Output #1
Yes

Among the five foods, the ones with the greatest tastiness are Food $3$ and $5$, of which he eats one.  
He dislikes Food $2$, $3$, and $4$, one of which he has a chance to eat: Food $3$.  
Therefore, the answer is `Yes`.
Input #2
5 2
100 100 100 1 1
5 4
Output #2
No

The foods with the greatest tastiness are Food $1$, $2$, and $3$, none of which he has a chance to eat.
Input #3
2 1
100 1
2
Output #3
No

The food with the greatest tastiness is Food $1$, which he has no chance to eat.
API Response (JSON)
{
  "problem": {
    "name": "Takahashi's Failure",
    "description": {
      "content": "Takahashi has $N$ foods in his house. The $i$\\-th food has the tastiness of $A_i$.   He dislikes $K$ of these foods: for each $i=1,2,\\ldots,K$, he dislikes the $B_i$\\-th food. Out of the foods with th",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc252_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Takahashi has $N$ foods in his house. The $i$\\-th food has the tastiness of $A_i$.  \nHe dislikes $K$ of these foods: for each $i=1,2,\\ldots,K$, he dislikes the $B_i$\\-th food.\nOut of the foods with th...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments