#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;
const in INF=1<<30;


int main(){
   in n,m;
    cin>>n>>m;
  vector<in> a(m);

  rep(i,m) cin>>a.at(i);
  sort(all(a));
  in dp[100010];
  //rep(i,n+1) dp[i] =INF;
  dp[1]=1;
  dp[2]=2;
  if()
  if(n==1){cout<<1;return 0;}
  if(n==2){if(m==0){cout<<2;} else cout<<1;return 0;}
  if(!a.empty())if(a[0]==1){dp[1]=0;dp[2]=1;a.erase(a.begin());}
  if(!a.empty()){if(a[0]==2){dp[2]=0;a.erase(a.begin());}}
  
  
  for(in i=3;i<=n;i++){
    if(!a.empty()){if(i==a[0]){
      dp[i]=0;
      a.erase(a.begin());
      continue;
    }}
     dp[i]=dp[i-1]+dp[i-2];
    if(dp[i]>=waru) dp[i]-=waru;
  }
  cout<<dp[n];
}
