n,m = map(int,input().split())
mod = 10**9+7
a = [int(input()) for _ in range(m)]
s = [0]*(n+1)
s[0],s[1]=1,1
for i in range(2,n+1):
  s[i] = (s[i-1]+s[i-2])%mod
ans = s[a[0]-1]
for i in range(1,m):
  if a[i]-a[i-1] == 1:
    print(0)
    quit()
  ans = (ans*s[a[i]-a[i-1]-2])%mod
print((ans*s[n-a[m-1]-1])%mod)