def fib_memo(x):
  memo=[0]*(x+1)
  def fib(x):
    if x==0 or x==1:
      return 1
    elif memo[x]!=0:
      return memo[x]
    else:
      memo[x]=fib(x-1)+fib(x-2)
      return memo[x]
  return fib(x)

n,m=[int(x) for x in input().split()]
a=[-1]
for i in range(m):
  p=int(input())
  a.append(p)
a.append(n+1)
ans=1
c=1
for i in range(m+1):
  if a[i+1]-a[i]-2<0:
    print(0)
    c=0
    break
  elif a[i+1]-a[i]-2==0:
    ans*=1
  else:
    ans*=((fib_memo(a[i+1]-a[i]-2))%1000000007)
    ans=ans%1000000007
if c==1:
  print(ans)