#include<stdio.h>
#include<stdlib.h>

int main(void){
  int n;
  scanf("%d", &n);
  int m;
  scanf("%d", &m);
  int i,j;
  int brk[m];
  int flag[n];
  int fibos[m+1];
  for(i=0;i<m;i++){
    scanf("%d",&brk[i]);
    //printf("%d\n",brk[i]);
    if(i>0){
      //printf("%d",abs(brk[i]-brk[i-1]));
      if(abs(brk[i]-brk[i-1])==1){
        printf("0");
        return 0;
      }
    }
  }
  int idx=0;
  int ans = 1;
  int numfibo=0;
  for(i=1;i<n+1;i++){
    numfibo++;
    for(j=0;j<m;j++){
      if(i==brk[j]||i==n){
        //printf("numfibo:%d\n",numfibo);
        //printf("i:%d\n",i);
        ans = ans*fibo(numfibo-1);
        //printf("ans:%d\n",ans);
        i = i+1;
        numfibo=1;
      }
    }
  }
  printf("%d",ans%1000000007);
}

 
int fibo(int n)
{
  int f0, f1, f2;
  f0 = 0;
  f1 = 1;
  while(f1<n) {
    f2 = f1 + f0;
    f0 = f1;
    f1 = f2;
  }
  return f1;
}
