include<bits/stdc++.h>
using namespace std;
#define ll long long int  

ll mod = 1000000007;

ll add( ll x, ll y){
  ll wa = ( (x % mod) + (y % mod) ) % mod;
  return wa;
}
int main(){
  ll n,m;
  cin >> n >> m;
  set<ll> broken;
  for ( int i = 0; i < m; ++i ) {
    ll a;cin >> a;
    broken.insert(a);
  }
  vector<int> dp(n+5);
  dp[0] = 1;
  for ( ll i = 1; i <= n; ++i ) {
    if( broken.count(i) ) {
      dp[i] = 0;
    } else {
      dp[i] = (add(dp[i - 1], dp[i - 2]) % mod);
    }
  }

  cout << dp[n] % mod<< endl;
  return 0;
}
