a=input().split()
a=list(map(int,a))
l=[]
for i in range(a[0]+1):
    l.append(i)
v=0
while v<a[1]:
    h=int(input())
    l.remove(h)
    v+=1
b=0
pos=1
while b<len(l)-2:
    if l[b+1]==(l[b]+1) and (l[b+2])== (l[b]+2):
        pos=((pos%1000000007)*2)%1000000007
    elif l[b+1]==l[b]+1 and l[b+2]!= l[b]+2:
        pass
    elif l[b+1]!=l[b]+1 and l[b+2]== l[b]+2:
        pass
    elif l[b+1]==l[b]+2:
        pass
    else:
        pos=0
        break
    b+=1
print(pos%1000000007)