#include <iostream>
using namespace std;
unsigned long long fact(int n);
long comb(long n, long r);

unsigned long long fact(long n){
        long i;
        unsigned long long f;
        f = 1;
        if (n!=0){
                for (i=1; i<=n; i++){
                        f = f * (unsigned long long) i;
                }
        }
        return f;
}

long comb(long n, long r){
        unsigned long long a;
        a=1;
        if (r>n/2){
                r = n-r;
        }
        for (i=0;i<r);i++){
                a = a * (unsigned long long)(n-i)
        }
        return long(a  /  fact(r) );
}

int main(){
        long N, M, i, j;
        long b, c, d;
        cin >> N >> M;
        long a[M+2];
        
        a[0]=-1;
        if (M!=0){
                for (i=1; i<=M; i++){
                        cin >> a[i];
                }
        }
        a[M+1] = N+1;
        d = 1;
        for (i=0; i<=M; i++){
                b = a[i+1]-a[i]-2;
                c = 0;
                if (b==-1){
                        c=0;
                }else{
                        for (j=0; j<=b/2; j++){
                                c = c + comb( (b-j), j );
                        }
                }
                d = d * c;
                d = d%1000000007;
        }
        cout << d;
}
