#include <bits/stdc++.h>//復習必須
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
#define MOD = 1000000007
int main () {
    ll N , M ;
    cin >> N >> M ;
    
    vector<bool>oks(N + 1 , true) ;
    for(int i=0;i<M;++i){
    int a;cin>>a;
    oks[a]=false;
    }

   vector<ll>dp(N+1);
   dp[0]=1;
   for(int now=0;now<N;++now){
   for(int next=now+1;next<=min(N,now+2);++next){
   if(oks[next]){
   dp[next]+=dp[now];
   dp[next]%=MOD;
   }
   }
   }
  
   cout<<dp[N]<<endl;

    
    


   
    return 0 ;
}

 
