You are given an array $a$ of length $n$ (not necessarily sorted). You are also given $q$ queries of the type:
x
- determine if $x$ is in $a.$
Input
The first line of input consists of two integers, $n$ and $q.$
The second line of input consists of $n$ integers, $a_1, a_2, \dots, a_n.$
$q$ lines of input follow. The $(i+2)$th line of input consists of an integer $x_i$, the parameter to the $i$th query.
Output
On the $i$th line, if $a$ contains $x_i$, output Yes
, otherwise output No
.
Constraints
$1 \le n,q \le 10^5$
$1 \le a_i, x_i \le 10^{18}$
Sample Test Cases
Input | Output | |
---|---|---|
7 7 77777 777 7777 777777 7777 77 77777 7 77 777 7777 77777 777777 7777777 |
No Yes Yes Yes Yes Yes No |
Scoring: Per Subtask
Authored by s17r28
Appeared in 2021 Mini Competition 0