#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
using namespace std;
const long long mod = 1'000'000'007;

int main(){
  long long N,M;cin>>N>>M;
  vector<long long> a(M); for(auto &e:a) cin>>e;

  vector<long long> c(N+1);
  c[0] = 1;
  c[1] = 1; 
  long long ng = 0;
  if(a[ng]==1) { c[1] = 0; ng++; }

  for(long long i=2;i<=N;++i) {
    if (i==a[ng]) {
      c[i] = 0;
      ng++;
    }
    else {
      c[i] = (c[i-1] + c[i-2]) % mod;
    }
  }

  cout << c[N] << endl;
}

