#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
#define modbig (10*10*10*10*10*10*10*10*10+7)
using namespace std;

int main(){
  ll a[100005];
  a[0]=0; a[1]=1;
  rep(i,100002){
    a[i+2]=(a[i+1]+a[i])%modbig;
  }
  ll n,m;
  cin>>n>>m;
  ll cant[m];
  rep(i,m){
    cin>>cant[i];
  }
  ll ans=((n-cant[m-1])*cant[0])%modbig;
  for(int i=0;i<m-1;i++){
    ans=(ans*a[cant[i+1]-cant[i]-1])%modbig
  }
  cout<<ans;
}