#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
int main()
{
  ll N,M,i,j,A;cin>>N>>M;ll answer[N];bool condition[N];memset(condition,True,N);
  for(i=0;i<M;i++){cin>>A;answer[A]=0;condition[A]=False;}
  answer[0]=0;
  if(condition[1]){answer[1]=1;}else{answer[1]=0;}
  for(i=2;i<M;i++){if(!condition[i]){continue;}else{answer[i]=answer[i-1]+answer[i-2];}}
  cout<<answer[M-1]%1000000007<<endl;
  return 0;
}