#include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
define mod = 1000000007
  
int main() {
  int n,m;
  cin >> n >> m;
  vector<int> h(m);
  vector<bool> v(n,true);
  for(int i=0;i<m;i++){
    cin >> h.at(i);
    v.at(h.at(i)) = false;
  }
  int stop = 0;
  for(int i=0;i<m-1;i++){
    if(h.at(i+1)-h.at(i) == 1){
      stop = -1;
      break;
    }
  }
  
  if(stop == -1){
    cout << 0 << endl;
  }
  else {
    vector<long long> dp(n+1);
    dp[0]=1;
    for(int i=0;i<n;i++){
      for(int j=i+1;j<=min(n,i+2);j++){
        if(v.at(i)){
          dp[j] += dp[i];
          dp[j] %= mod;
        }
      }
    }
    
    cout << dp[n] << endl;
  }
  return 0;
}
