#include <bits/stdc++.h>
using namespace std;
int main() {
  
  int n,m;
  cin >> n >> m;
  int mod = 1000000007;
  vector<int> cont(N , 1);
  
  vector<int> dp(N+2);
  dp.at(N) = 1;
  dp.at(N+1) = 0;
  
  for(int i = 0 ; i < N ; i++){
    int a;
    cin >> a;
    cont.at(a) = 0;
  }
  
  for(int i = N - 1 ; i >= 0 ; i--){
    
    if(cont.at(i)){
      continue;
    }
      dp.at(i) = ( dp.at(i+1) + dp.at(i+2) ) % mod;
  }
  
  cout << dp.at(0) << endl;
}
    
    
    
    
  
  
    
  
  