#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<numeric>
#include<iomanip>
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define int long long

using namespace std;

//最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a % b);
}

//最小公倍数
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}

//階乗
ll factorial(ll a) {
	int ans = 1;
	for (int i = 1; i <= a; i++) {
		ans *= i;
	}
	return ans;
}

signed main() {
    ll mod = 1000000007; 
	int n, m;
	cin >> n >> m;
	vector<int>hole(m);
	rep(i, m) {
		cin >> hole[i];
	}
	rep(i, m - 1) {
		if (hole[i] + 1 == hole[i + 1]) {
			cout << 0 << endl;
			return 0;
		}
	}

	int ans = 1;
	int top = hole[0] - 1;
	int	lowest = 0;
	int temp = (top - lowest);
	int x = temp % 2;//1dann
	int y = temp / 2;//2dann
	int tem = 0;
	while (y > -1) {
		tem += factorial(x+y) / (factorial(y) * factorial(x));
		y--;
		x += 2;
	}
	ans = ans * tem % mod
	tem = 0;

	REP(i, 1, m) {
		lowest = top + 2;
		top = hole[i] - 1;
		temp = (top - lowest);
		x = temp % 2;
		y = temp / 2;
		while (y > -1) {
			tem += factorial(x+y) / (factorial(y) * factorial(x));
			y--;
			x += 2;
		}
		ans = ans * tem % mod;
		tem = 0;
	}

	lowest = top + 2;
	top = n;
	temp = (top - lowest);
	x = temp % 2;
	y = temp / 2;
	while (y > -1) {
		tem += factorial(x+y) / (factorial(y) * factorial(x));
		y--;
		x += 2;
	}
	ans = ans * tem % mod;
	cout << ans << endl;
	return 0;
}
