#include<bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using namespace std;

int main(){
  ll n,m;cin>>n>>m;
  ll a[m],b[n]={1,1},mod=7+1e9,sum=1;
  for(ll i=0;i<m;i++){
    cin>>a[i];
    if(i==0)continue;
    if(a[i]-a[i-1]==1){cout<<0;return 0;}
  }
  rep(i,n-1)b[i+2]=b[i]+b[i+1];
  for(ll i=0;i<m;i++){
    if(i==0)sum*=b[a[i]-1]%mod;
    else{
      sum*=b[a[i]-a[i-1]-2];
      sum%=mod;
      }
  }

  if(m==0)cout<<b[n]<<endl;
  else{
    sum*=b[n-a[m-1]-1];
    cout<<sum%mod<<endl;
  }
}