Problem: You are given an array A of size N, and Q queries to deal with. For each query, you are given an integer X, and you're supposed to find out if X is present in the array A or not.

Input:
The first line contains two integers, N and Q, denoting the size of array A and number of queries. The second line contains N space separated integers, denoting the array of elements Ai. The next Q lines contain a single integer X per line.

Output:
For each query, print YES if the X is in the array, otherwise print NO.

Constraints:
1 ≤ N, Q ≤ 10^5
1 ≤ Ai ≤ 10^9
1 ≤ X ≤ 10^9

SAMPLE INPUT
5 10
50 40 30 20 10
10
20
30
40
50
60
70
80
90
100

SAMPLE OUTPUT
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO

Solution (in PYTHON):

Solution:
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'

def Bsearch(arr, beg, end, val):
	if beg <= end:
		mid = (beg+end)/ 2
		if arr[mid] == val:
			print 'YES'
			return
		elif arr[mid] > val:
			Bsearch(arr, beg, mid-1, val)
		elif arr[mid] < val:
			Bsearch(arr, mid+1, end, val)
	else:
		print 'NO'
n , q = map(int, raw_input().split())
A = map(int, raw_input().split())
A.sort()

for i in range(q):
	num = input()
	if num < A[0] and num > A[n-1]:
		print 'NO'
	else:
		Bsearch(A, 0, n-1, num)
	# 	print 'YES'
	# else:
	# 	print 'NO'