a = list(map(int, input().split()))
#print(a)
try:
    b=[0]*a[1]
    c=[0]*(a[1]+1)
    b[0]=int(input())
    c[0]=b[0]-0
    for x in range(a[1]-1):
        b[x+1]=int(input())
        c[x+1]=b[x+1]-b[x]-1
    c[-1]=a[0]-b[-1]
    max = 0
    min = a[0]+100
except:
    print(0)
for x in c:
    if x>max:
        max=x
    if x<min:
        min=x
        
#print(c)
#print(max," ",min)
if min==0:
    print(0)
else:
    num=[0]*(max)
    for x in range(max):
        if x==0:
            num[0]=1
        elif x==1:
            num[1]=1
        else:
            num[x]=num[x-1]+num[x-2]
        #print("num[",x,"]=",num[x])
        
    answer=1
    for x in c:
        answer *=num[x-1]
        if answer==0:
            print(0)
            break
        else:
            answer%=1000000007
    print(answer)