Little boy Petya loves stairs very much. But he is bored from simple going up and down them — he loves jumping over several stairs at a time. As he stands on some stair, he can either jump to the next one or jump over one or two stairs at a time. But some stairs are too dirty and Petya doesn't want to step on them.

Now Petya is on the first stair of the staircase, consisting of n stairs. He also knows the numbers of the dirty stairs of this staircase. Help Petya find out if he can jump through the entire staircase and reach the last stair number n without touching a dirty stair once.

One has to note that anyway Petya should step on the first and last stairs, so if the first or the last stair is dirty, then Petya cannot choose a path with clean steps only.


-----Input-----

The first line contains two integers n and m (1 ≤ n ≤ 10^9, 0 ≤ m ≤ 3000) — the number of stairs in the staircase and the number of dirty stairs, correspondingly. The second line contains m different space-separated integers d_1, d_2, ..., d_{m} (1 ≤ d_{i} ≤ n) — the numbers of the dirty stairs (in an arbitrary order).


-----Output-----

Print "YES" if Petya can reach stair number n, stepping only on the clean stairs. Otherwise print "NO".


-----Examples-----
Input
10 5
2 4 8 3 6

Output
NO
Input
10 5
2 4 5 7 9

Output
YES

Difficulty: interview

Starter code:

Solutions:
n,m=list(map(int,input().split()))
if(m!=0):
    L=list(map(int,input().split()))
else:
    L=[]

L.sort()
valid=True
for i in range(2,m):
    if(L[i]-L[i-2]==2):
        valid=False
if(m==0 or(valid and L[0]!=1 and L[-1]!=n)):
    print("YES")
else:
    print("NO")


N, M = list(map(int, input().split()))
if M > 0:
    Dirty = list(sorted((list(map(int, input().split())))))
    Flag = Dirty[0] != 1 and Dirty[-1] != N
    if Flag:
        Last = Dirty[0]
        Amount = 1
        for Num in Dirty:
            if Last + 1 == Num:
                Amount += 1
            else:
                Amount = 1
            Last = Num
            if Amount == 3:
                Flag = False
                break
    if Flag:
        print("YES")
    else:
        print("NO")
else:
    print("YES")


n,m=map(int,input().split())
if m==0:
    print("YES")
    return
a=set(map(int,input().split()))
l=0
for i in a:
    if (i+1 in a)and(i+2 in a):
        l+=1
if (1 in a) or (n in a)or(l>0):
    print('NO')
else:
    print('YES')

def  readln():
    return  list(map(int, input().split()))

n, k = readln()
dirties = []
if  k > 0:
    dirties = readln()

dirties = sorted(dirties)

prevprev =  -1
prev =  -1
ilegal = False

for  val  in  dirties:
    if prevprev == -1:
        prevprev =  val
        continue
    if prev == -1:
        prev =  val
        continue
    if prevprev == prev - 1 and  prev == val - 1:
        ilegal = True

    prevprev = prev
    prev =  val

#print (dp)

if ilegal or (k > 0 and (dirties[0] == 1 or dirties[-1] == n)):
    print ("NO")
else:
    print ("YES")




#/usr/bin/env python

import sys

n,m = tuple(int(x) for x in input().split(" ") if len(x)>0)
if m==0:
	print("YES")
	return

d = [int(x) for x in input().split(" ") if len(x)>0]



d.sort()


def solve():
	if d[0] == 1:
		return "NO"

	if d[-1] == n:
		return "NO"

	lc=0
	for x in range(m-1):
		i = d[x]
		j = d[x+1]
		if i == j-1:
			lc += 1
			if lc > 1:
				return "NO"
		else:
			lc = 0

	return "YES"

print(solve())

a=list(map(int,input().split()))

if a[1]==0:
    print('YES')
else:
    m=list(map(int,input().split()))
    m.sort()
    Max,c=0,1
    if m[0]!=1 and m[-1]!=a[0]:
        for i in range(len(m)-1):
            if m[i]==m[i+1]-1:
                c+=1
                if c>Max:
                    Max=c
            else:
                c=1
        if Max<3:
            print('YES')
        else:
            print('NO')
    else:
        print('NO')


import sys


def check_stairs(n, stairs):
    if len(stairs) == 0:
        print('YES')
        return
    if stairs[0] == 1 or stairs[-1] == n:
        print('NO')
        return
    for i in range(len(stairs) - 2):
        if stairs[i] + 1 == stairs[i+1] and stairs[i] + 2 == stairs[i+2]:
            print('NO')
            return
    print('YES')


def __starting_point():

    nm_list = [int(c) for c in sys.stdin.readline().rstrip().split(' ')]
    (n, m) = tuple(nm_list)
    stairs = []
    if m > 0:
        stairs = [int(c) for c in sys.stdin.readline().rstrip().split(' ')]
        stairs.sort()
    check_stairs(n, stairs)

__starting_point()

n, m = list(map(int, input().split()))

if m == 0:
    ok = True
else:
    hole = sorted(map(int, input().split()))
    ok = hole[0] != 1 and hole[-1] != n
    for i in range(2, m):
        if hole[i] == hole[i-1]+1 == hole[i-2]+2:
            ok = False
            break

print("YES" if ok else "NO")




n, m = map(int,input().split())
if m >= 1:
    gr = list(map(int, input().split()))
    gr.sort()
k = 1
if (m >= 1 and gr[0] == 1) or (m >= 1 and gr[m-1]) == n:
    print('NO')
else:
    for i in range(m-2):
        if gr[i] == gr[i+1] - 1 == gr[i+2] - 2:
            print('NO')
            k = 0
            break
    if k == 1:
        print('YES')

n, m = [int(x) for x in input().split()]
d=[]
found = False
if m!=0:
	d = [int(x) for x in input().split()]
	d.sort()
	
	if d[0]==1 or d[m-1]==n:
		print("NO")
		found = True


if not found:
	found=False
	for i in range(2, m):
		if d[i-2]==d[i]-2 and d[i-1]==d[i]-1:
			found=True
			print("NO")
			break
	
	if not found:
		print("YES")



n,m = list(map(int,input().split()))

if m>0:
    num = [int(x) for x in input().split()]
    num.sort()

ret = True

if m>0:
    if num[0] == 1 or num[m-1]==n: ret=False

if m>2:
    for i in range(m-2):
        if num[i]+2 == num[i+1]+1 == num[i+2]: ret = False

print("YES" if ret else "NO")


3

def readln(): return tuple(map(int, input().split()))

n, m = readln()
d = sorted(readln()) if m else []
if m and (d[0] == 1 or d[-1] == n) or m > 2 and [1 for i, j, k in zip(d[:-2], d[1:-1], d[2:]) if i + 2 == k]:
    print('NO')
else:
    print('YES')


n, m = map(int, input().split())
if m == 0: print('YES')
else: 
    t = list(map(int, input().split()))
    t.sort()
    if t[0] == 1 or t[-1] == n: print('NO')
    else:
        k = s = 0
        for i in t:
            if i == k:
                s += 1
                k += 1
                if s > 1:
                    s = -1
                    break
            else: k, s = i + 1, 0
        print('YNEOS'[s == -1 :: 2])

def canJump(numStairs, dirty):
    maxJump = 2
    counter = 0
    dirty.sort()
    if dirty[0] == 1 or dirty[-1] == numStairs:
        return False
    for i in range(1, len(dirty)):
        if dirty[i - 1] + 1 == dirty[i]:
            counter += 1
            if counter >= maxJump:
                break;
        else:
            counter = 0
    else:
        return True
    return False
s1 = input()
if int(s1.split(' ')[1]) == 0:
    print('YES')
else:
    s2 = input()
    if canJump(int(s1.split(' ')[0]), [int(s) for s in s2.split(' ')]):
        print('YES')
    else:
        print('NO')




R = lambda: map(int, input().split())
n, m = R()
d = sorted(R()) if m > 0 else []
print("YES" if len(d) == 0 or d[0] != 1 and d[m - 1] != n and all(d[i + 2] - d[i] > 2 for i in range(m - 2)) else "NO")

R = lambda: map(int, input().split())
n, m = R()
d = sorted(R()) if m > 0 else [0]
print("NO" if d[0] == 1 or d[-1] == n or any(d[i + 2] - d[i] < 3 for i in range(m - 2)) else "YES")

n, m = map(int, input().split())
if m > 0:
    a = list(map(int, input().split()))
    a.sort()
    k = 0
    k1 = 1
    for i in range(1, m):
        if a[i] == a[i - 1] + 1:
            k1 += 1
        else:
            k = max(k, k1)
            k1 = 1
    k = max(k, k1)
    if k > 2 or (m >= 1 and (a[0] == 1 or a[-1] == n)):
        print('NO')
    else:
        print('YES')
else:
    print('YES')



"""k = []
for i in range(5):
    k.append([int(x) for x in (sys.stdin.readline()).split()])
    
vmax = 0 
tt = []
for i in range(5):
    for j in range(i, 5):
        if(i != j):
            k[i][j] = k[j][i] = k[i][j] + k[j][i]
                

for i in range(5):
    print(k[i])"""
  
  
import sys
import math
  
n, m = [int(x) for x in (sys.stdin.readline()).split()]
dm = [int(x) for x in (sys.stdin.readline()).split()]

dm.sort()

if(m == 0):
    print("YES")
    return

if(dm[0] == 1 or dm[m - 1] == n):
    print("NO")
    return
    
val = 0
for i in range(m - 1):
    if(math.fabs(dm[i] - dm[i + 1]) == 1):
        val += 1
    else:
        val = 0   
    if(val > 1):
        print("NO")
        return
        
print("YES")



n, m = (int(x) for x in input().split())
if m == 0:
    print('YES')
    return
s = set()
for d in (int(x) for x in input().split()):
    s.add(d)
    if d == 1 or d == n:
        print('NO')
        return
    elif (d - 1) in s and ((d - 2) in s or (d + 1) in s):
        print('NO')
        return
    elif (d + 1) in s and (d + 2) in s:
        print('NO')
        return
print('YES')

n, m = [int(x) for x in input().split()]
if m:
	l = sorted([int(x) for x in input().split()])
else:
	l = []
if len(l) and (l[0] == 1 or l[-1] == n):
	print('NO')
	return
for i in range(m - 2):
	if l[i + 2] == l[i + 1] + 1 and l[i + 1] == l[i] + 1:
		print('NO')
		break
else:
	print('YES')


def main():
    n, m = map(int, input().split())
    res = True
    if m:
        l = sorted(map(int, input().split()))
        res = l[0] != 1 and l[-1] != n
        if res and m > 2:
            for a, b, c in zip(l, l[1:], l[2:]):
                if b - a == 1 == c - b:
                    res = False
                    break
    print(('NO', 'YES')[res])


def __starting_point():
    main()
__starting_point()

inStr=input()
n=int(inStr.split()[0])
m=int(inStr.split()[1])
ans='YES'
if not m==0:
    inStr=input()
    dirty=[int(x) for x in inStr.split()]

    sDirty=sorted(dirty)
    if sDirty[0]==1 or sDirty[-1]==n:
        ans='NO'
    else:
        for i in range(len(sDirty)-2):
            cur=sDirty[i]
            if sDirty[i+1]==cur+1 and sDirty[i+2]==cur+2:
                ans='NO'
                break

print(ans)

# coding: utf-8
n, m = [int(i) for i in input().split()]
if not m:
    print('YES')
    return
d = [int(i) for i in input().split()]
if n in d or 1 in d:
    print('NO')
    return
d.sort()
i = 0
while i < m-2:
    if d[i+2]-d[i+1]==1:
        if d[i+1]-d[i]==1:
            print('NO')
            break
        else:
            i += 1
    else:
        i += 2
else:
    print('YES')