#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdbool.h>
#include<math.h>
#include<sstream>
#include<math.h>
#include<vector>
#include<functional>
#include<queue>
#include<utility>
#include<bitset>
typedef long long ll;
#define N (1000000000+7)
#define INF 1e16
using namespace std;
typedef pair<ll, ll> P;
ll level;
struct edge {
	ll to;
};

vector<edge>G[100010];
ll d[100010];

bool cmp(const pair<ll, ll> &a, const pair<ll, ll> &b) {
	if (a.second == b.second)return a.first < b.first;
	else return a.second > b.second;
}

void dfs(int root,vector<ll> &c) {
	d[root] = c[level];
	level--;
	for (auto itr = G[root].begin();itr != G[root].end();++itr) {
		//cout << itr->to << endl;
		if (d[itr->to] == 0)dfs(itr->to, c);
	}
	return;
}

int main(void) {
	ll n, m;
	cin >> n >> m;
	if (n == 1) {
		cout << 1 << endl;
		return 0;
	}
	if(m!=0)vector<ll>w(m);
	ll ans = 0;
	for (ll i = 0;i < m;i++)cin >> w[i];
	ll dp[100010] = { 0 };
	dp[0] = 0;
	dp[1] = 1;
	dp[2] = 2;
	for (ll i = 3;i <= n;i++)dp[i] = (dp[i - 1] % N + dp[i - 2] % N) % N;
	if (m == 0) {
		cout << dp[n] << endl;
		return 0;
	}
	if (w[0] == 1)ans = 1;
	else ans = (dp[w[0] - 1]) % N;
	for (ll i = 1;i < m;i++) {
		if (w[i] - w[i - 1] - 1 <= 0)ans = ans * 0;
		else {
			if (w[i] - w[i - 1] - 1 == 1)ans = ans * 1;
			else {
				ans = (ans*(dp[w[i] - w[i - 1] - 2]) % N) % N;
			}
		}
	}
	if (n - w[m - 1]>1)ans = (ans*(dp[n - w[m - 1]-1]) % N) % N;
	cout << ans << endl;
	return 0;
}