#include <bits/stdc++.h>
using namespace std;
 
int main() {

  uint64_t v = 1000000007;
  
  int N, M;
  cin >> N >> M;
  
  if ( N == 1 ) {
    else cout << 1 << endl;
    return 0;
  }
  
  vector<uint64_t> dp(100007, 1);
  
  for (int i=0; i<M; i++) {
    int n; cin >> n;
    dp.at(n-1) = 0;
  }
  
  int p = 0;
  while ( p < N ) {
    p++;
    if( dp.at(p-1) && dp.at(p) ) {
      dp.at(p) = 2;
      break;
    } 
  }
  for (int i=0; i<N-1; i++) {
    if( !dp.at(i) ) {
      if( !dp.at(i+1) ) {
        cout << 0 << endl;
        return 0;
      }
      else if ( dp.at(i+2) ) {
        dp.at(i+2) = dp.at(i+1);
      }
    }
    else if ( dp.at(i+2) ) {
      if ( !dp.at(i+1) )  dp.at(i+2) = dp.at(i);
      else dp.at(i+2) = (dp.at(i) + dp.at(i+1)) % v;
    }
  }
  
  cout << dp.at(N-1) << endl;
  
  return 0;
}