#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
  int n,m;
  long long ans=1;
  cin>>n>>m;
  int b[m];
  rep(i,m){
    cin>>b[i];
    if(i>0&&b[i]==b[i-1]+1)
      ans=0;
  }
  if(ans==0)
    cout<<ans<<endl;
  
  
  else{
    long long a[n];

    a[0]=1;a[1]=1;
    rep(i,n-1){
      a[i+2]=a[i]+a[i+1];
      a[i+2]=%=1000000007;
    }
  
    rep(i,m+1){
      if(i==0){
        if(m==0)
          ans*=a[n];
        else
          ans*=a[b[0]-1];
      }else if(i==m){
        ans*=a[n-1-b[m-1]];
      }else {
        ans*=a[b[i]-b[i-1]-2];
      }
      
    }
    cout<<ans%1000000007<<endl;
    
  }
  
}