#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,b;
  cin>>n>>b;
  int f=1;
  vector<int> broken(b);
  for(int i=0;i<b;i++){
    cin>>b[i];
    if(i>=1&&b[i]-b[i-1]==1){f=0; break;}
    else{n-=2;}
  }
  vector<int> a(n);
  a[0]=1;
  a[1]=2;
  for(int i=2;i<n;i++){
    a[i]=a[i-1]%1000000007+2*a[i-2]%1000000007;
  }
  if(f){cout<<a[n-1]%1000000007;}
  else{cout<<0;}
}
