#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <functional>
#include <cstring>
#include <cmath>

using namespace std;
#define inputInt(a) int a; cin >> a; 
#define inputInt2(a,b) int a; int b; cin >> a >> b; 
#define inputInt3(a,b,c) int a; int b; int c; cin >> a >> b >> c;
#define inputLong(a) long a;cin >> a; 
#define inputIntArray(a,N) int a[N];for(int i=0;i<N;i++){cin >> a[i];}
#define inputIntArray2(a,b,N) int a[N]; int b[N]; for(int i=0;i<N;i++){cin >> a[i] >> b[i];}
#define output(answer) cout << answer << endl;
#define fN(i,N)    for(int i=0; i<N; i++)
#define fSE(i,s,e) if(e>=s) for(int i=s; i<=e; i++)

int main()
{ 
  //input
  inputInt2(N,M);
  inputIntArray(a,M);
  
  int a_max,a_min;
  int mod = 1e9 + 7;
  long ans;
  
  if(M>=1){
    a_max = max(a[0],N-a[M-1]);
    a_min = min(a[0],N-a[M-1]);
    fSE(i,1,M-1) {a_max = max(a_max, a[i]-a[i-1]-1); a_min = min(a_min, a[i]-a[i-1]-1);}
    
    //memo埋め
    long memo[a_max+1]={0};//1→1段上る場合の数 max段上る→memo[max]
    memo[0]=1; memo[1]=1; memo[2]=2;
    fSE(i,3,a_max) memo[i] = (memo[i-1]+memo[i-2])%mod;
    
    //output
    if(a_min == 0){output(0);}
    else{
      ans = (memo[a[0]-1]%mod)*(memo[N-a[M-1]-1]%mod);//a[0]-1段上る場合の数 a[]
      if(M-1>=1) fSE(i,1,M-1) {ans *= (memo[a[i]-a[i-1]-2]%mod);}
      output(ans%mod);
    }
    
  } else {//M=0の時=壊れている段が無い時
    long memo[N]={0};//1→1段上る場合の数 max段上る→memo[max]
    memo[0]=1; memo[1]=1; memo[2]=2;
    fSE(i,3,N) memo[i] = (memo[i-1]+memo[i-2])%mod;
    
    ans = memo[N]%mod;
    output(ans);
  }

  return 0;
  
}