#include"bits/stdc++.h"
#define INFLL        1e18
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define DELNL        cin.ignore(numeric_limits<streamsize>::max(),'\n')
#define VV(T,h,w)    vector<vector<T>>(h,vector<T>(w))
#define VVI(T,h,w,i) vector<vector<T>>(h,vector<T>(w,i))
using namespace std;
using ll=long long;using ull=unsigned long long;
template<typename T=ll>inline T in(){T ret;cin>>ret;return ret;}

template<ull mod,ull cnt_div=2>
class basic_mod_int{
private:
    static ull pow_mod(ull x,ull y){x%=mod;return(y==0?1:y%2==0?pow_mod(x*x%mod,y/2):x*pow_mod(x,y-1))%mod;}
    ull num;
public:
    basic_mod_int()=default;basic_mod_int(ull num):num(num%mod){}
    explicit operator ull()const{return num;}
    basic_mod_int<mod,cnt_div> operator~ ()       const{return basic_mod_int(pow_mod(num,mod-cnt_div));}
    basic_mod_int<mod,cnt_div> operator+ (ull arg)const{arg%=mod;return basic_mod_int(num+arg);}
    basic_mod_int<mod,cnt_div> operator- (ull arg)const{arg%=mod;return basic_mod_int(max(num,arg)-min(num,arg));}
    basic_mod_int<mod,cnt_div> operator* (ull arg)const{arg%=mod;return basic_mod_int(num*arg);}
    bool                       operator==(ull arg)const{return num==arg;}
    bool                       operator!=(ull arg)const{return!operator==(arg);}
    basic_mod_int<mod,cnt_div>&operator= (ull arg)     {num=arg;return*this;}
    basic_mod_int<mod,cnt_div>&operator+=(ull arg)     {num=(ull)operator+(arg);return*this;}
    basic_mod_int<mod,cnt_div>&operator-=(ull arg)     {num=(ull)operator-(arg);return*this;}
    basic_mod_int<mod,cnt_div>&operator*=(ull arg)     {num=(ull)operator*(arg);return*this;}
    basic_mod_int<mod,cnt_div> operator+ (const basic_mod_int<mod,cnt_div>&mi)const{return operator+ ((ull)mi);}
    basic_mod_int<mod,cnt_div> operator- (const basic_mod_int<mod,cnt_div>&mi)const{return operator- ((ull)mi);}
    basic_mod_int<mod,cnt_div> operator* (const basic_mod_int<mod,cnt_div>&mi)const{return operator* ((ull)mi);}
    bool                       operator==(const basic_mod_int<mod,cnt_div>&mi)const{return operator==((ull)mi);}
    bool                       operator!=(const basic_mod_int<mod,cnt_div>&mi)const{return operator!=((ull)mi);}
    basic_mod_int<mod,cnt_div>&operator= (const basic_mod_int<mod,cnt_div>&mi)     {return operator= ((ull)mi);}
    basic_mod_int<mod,cnt_div>&operator+=(const basic_mod_int<mod,cnt_div>&mi)     {return operator+=((ull)mi);}
    basic_mod_int<mod,cnt_div>&operator-=(const basic_mod_int<mod,cnt_div>&mi)     {return operator-=((ull)mi);}
    basic_mod_int<mod,cnt_div>&operator*=(const basic_mod_int<mod,cnt_div>&mi)     {return operator*=((ull)mi);}
};

constexpr ull sz=100010;
using mod_int=basic_mod_int<1000000007>;
vector<mod_int>fact_mod(sz),fact_inv(sz);
mod_int stair_mod(ll n)
{
    mod_int ret=0;
    for(ll a=n,b=0;a>=0;a-=2,b+=1)ret+=fact_mod[a+b]*fact_inv[a]*fact_inv[b];
    return ret;
}
int main()
{
    ll n=in(),m=in();
    vector<ll>a(m);REP(i,m)a[i]=in();a.push_back(n+1);

    fact_mod[0]=1;REP(i,sz-1)fact_mod[i+1]=fact_mod[i]*(i+1);
    REP(i,sz)fact_inv[i]=~fact_mod[i];
    ll now=0;
    mod_int ans=1;
    REPC(ai,a){
        ans*=stair_mod(ai-now-1);
        now=ai+1;
    }
    cout<<(ull)ans<<endl;
}

Measured memory_bytes: 3328