#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<int> v;
typedef vector<ll int> vll;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
const int INF = 1001001001;
const int mINF = -1001001001;
const int mod = 1000000007;
// << fixed << setprecision(0) <<
// sort(ALL(),greater<int>());


int main() {
  ll n,m;
  cin >> n >> m;
  vll a(m);
  for(ll i=0;i<m;i++) cin >> a[i];
  sort(ALL(a));
  ll ans[n+1];
  ans[0]=1;
  ll j=0;
  for(ll i=1;i<=n;i++){
    if(i==a[j]) {
      ans[i]=0;
      j++;
      if(j>=m) j=0; 
    } else if(i==1) {
      ans[i]=ans[i-1];
    } else {
      ans[i]=ans[i-1]+ans[i-2];
    }
    ans[i]%=mod;
  }
  cout << ans[n] << endl;
  return 0;
}
