n,m=map(int,input().split())
broken=[int(i) for i in range(n)]
mod=10**9+7

factorial=[1]
for i in range(1, n+1):
    factorial.append(factorial[-1] * i % mod)

inv_factorial = [-1] * (n+1)
inv_factorial[-1] = pow(factorial[-1], mod-2, mod)

for i in reversed(range(n)):
    inv_factorial[i] = inv_factorial[i+1] * (i+1) % mod

def fact(n):
    return factorial[n]

def nck(n, k):
    if k>n or k<0:
        return 0
    else:
        return factorial[n] * inv_factorial[n-k] * inv_factorial[k]

def cnt(n):
    ans=0
    for i in range(n//2+1):
      ans+=nck(n-i,i)
      ans%=mod
    return ans

ans=cnt(broken[0]-1)
for i in range(1,m):
  tmp=broken[i]-broken[i-1]-2
  if tmp==-1:
    ans=0
    break
  else:
    ans*=cnt(tmp)
    ans%=mod
    
tmp=n-broken[m-1]-1
ans*=cnt(tmp)
print(ans)