#include<bits/stdc++.h>

#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge] << '\n'
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
const ll INF = INT_MAX;
const ll MOD = 1e9+7;


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N,M;cin>>N>>M;
  ll a[N];
  for(ll i=0;i<M;i++){
    cin>>a[i];
  }
  ll dp[N+10]={1};
  ll j=0;
  for(ll i=0;i<N;i++){
    while(j<M&&a[j]<i)j++;
    if(i==a[j])continue;
    dp[i+1] = (dp[i+1]+dp[i])%MOD;
    dp[i+2] = (dp[i+2]+dp[i])%MOD;
  }
  cout<<dp[N]<<endl;
  return 0;
}
