n,m=map(int,input().split())
mod = 1000000007
temp=[]
for i in range(m):
    a=int(input())
    temp.append(a)
ans=1
k=0

memo=[0,1,1]
for i in range(2,n):
    memo.append(memo[i]+memo[i-1])

if m==0:
    print(n-1)
elif m==1:
    print((temp[0]-1)*(n-temp[0]-1))
elif m>1:
    for i in range(m-1):
        if (temp[i]+1)==temp[i+1]:
            k=1
        else:
            kumi=temp[i+1]-temp[i]-1
            ans=(ans*(memo[kumi]%mod))%mod
    if k==1:
        print("0")
    else:
        end=memo[n-temp[m-1]-1]
        first=memo[temp[0]]
        if end<2 and first<2:
            print(ans)
        elif end<2 and first>1:
            print((ans*(first%mod))%mod)
        elif end>1 and first<2:
            print((ans*(end%mod))%mod)
        elif end>1 and first>1:
            print((ans*(end%mod)*(first%mod))%mod)