n, k = map(int, input().split())
matrix = list(map(int, input().split()))
p = (n // 2) + 1
l = 0
s = 0
while l < k:
m = 0
t = 0
l += 1
while t < n:
if l == matrix[t]: m += 1
t += 1
if m >= p:
s = 1
print('YES')
break
if s == 0: print('NO')