#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
#define all(a) (a).begin(),(a).end()
#define rep(i,n) reps(i,0,n)
#define reps(i,m,n) for(int i=(m);i<(n);i++)
int main(){
  ll n,m;cin>>n>>m;
  vector<bool> b(n+1,false);
  vector<ll> a(n+1,0);
  a[0]=1;
  rep(i,m+1){
    int c;cin>>c;
    b[c]=true;
  }
  rep(i,1,n+1){
    if(i==1)a[1]=1;
    else a[i]=(a[i-1]+a[i-2])%M;
    if(b[i])a[i]=0;
  }
  cout<<a[n];
}