#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

int main(){
  int N,M;
  cin>>N>>M;
  vector<long long> a(N+1,0);
  vector<int> noentry(M,0);
  for(int i=0; i<M;i++){
    cin>>noentry[i];
  }
  sort.(noentry.begin(),noentry.end());
  a[0]=1;
  if(M!=0){
    a[noentry[0]]=-1;
    for(int i=1; i<noentry.size(); i++){
      if(noentry[i]-1==noentry[i-1]){
        cout<<0<<endl;
        return 0;
      }
      a[noentry[i]]=-1;
    }
  }
  
  if(a[1]==0){
    a[1]=1;
  }
  for(int i=2; i<a.size(); i++){
    if(a[i]==-1) continue;
    if(a[i-1]==-1){ a[i] = a[i-2]; continue;}
    if(a[i-2]==-1){ a[i] = a[i-1]; continue;}
    a[i] = a[i-1] + a[i-2];
  }
  cout<<a.back()%1000000007<<endl;
  return 0;
}
  
