//g++ -std=gnu++14 a.cpp
//#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>

using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;




int main(){
  ll N,M;
  cin >> N >> M;
  vector<ll> h(1000000);
  vector<ll> dp(1000000, 0);
  vector<ll> ok(1000000, 1);
  rep(i,M) cin >> h[i];
  rep(i,M){
    ok[h[i]] = 0;
  }
  dp[0] = 1;
  for(int i = 0;i <= N;i++){
    if(ok[i+1]) dp[i+1]%MOD += dp[i]%MOD;
    if(ok[i+2]) dp[i+2]%MOD += dp[i]%MOD;
  }
  /*
rep(i,N+1){
  cout << dp[i] << endl;
} */
  cout << dp[N]%MOD << endl;
}
