#include <bits/stdc++.h>
#include <algorithm>

#define REP(i,n) for(ll i = 0;i < n;++i)
#define PB(s) push_back(s)
#define ST(n) sort(n.begin(),n.end())

using namespace std;
typedef long long ll;
int inf=-1;
typedef pair<int,int> P;
int main(void){
    ll n,m,i,x;
    cin>>n>>m;
    ll dan[n+1]={1,1,2},f[n+1];
    for(i=0;i<n+1;i++)f[i]=1;
    for(i=0;i<m;i++){
        cin>>x;
        f[x]=0;
    }
    for(i=2;i<=n;i++){
   
        dan[i]=(dan[i-1]*f[i-1]+dan[i-2]*f[i-2])%1000000007;
      }
    cout<<dan[n]%1000000007<<endl;
}