#include<iostream>
using namespace std;
const ll mo=1e9+7;
ll a[100005], re[100005];

int main(){
 ll i,j,k,n,m,t;
  cin>>n>>m;
  ll f=0,pre=-1;
  for(i=0;i<m;i++){
    cin>>k;
    if(k-pre==1){
     f=1; 
    }
    pre=k;
    a[k]=1;
  }
  if(f) cout<<"0\n";
  else {
    re[0]=1;
    if(!a[1]) re[1]=1;
    if(!a[2]) re[2]=2;
    for(i=3;i<=n;i++){
      if(a[i]) continue;
      a[i]=0;
      if(!a[i-1]) a[i]+=a[i-1], a[i]%=mo;
      if(!a[i-2]) a[i]+=a[i-2],a[i]%=mo;
    }
    cout<<a[n]<<"\n";
  }
}