#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	int N, M;
	cin >> N >> M;
	vector<long long int> s(M), t(N), d(M + 1);
	for(int i = 0; i < M; ++i) {
		cin >> s[i];
	}
	t[0] = 1;
	t[1] = 1;	
	if(M == 0) {
		for(int i = 2; i < N; ++i) {
			t[i] = t[i - 1] + t[i - 2];
			t[i] = t[i] % 1000000007;
		}
		cout << t[N - 1] % 1000000007 << endl;
	} else { 
		d[0] = s[0] - 1;
		if(M >= 2) {
			for(int i = 1; i < M; ++i) {
				d[i] = s[i] - s[i -1];
			}
		}
		d[M] = N - s[M - 1];
		int max_d = *max_element(d.begin(),d.end());
		int min_d = *min_element(d.begin(),d.end());
		if(min_d <= 1 && d[0] != 1 && d[0] != 0) {
				cout << 0 << endl; 
			} else {
			//cout << "max = " << max_d << endl;
			for(int i = 2; i < max_d; ++i) {
				t[i] = t[i - 1] + t[i - 2];
				t[i] = t[i] % 1000000007;
				//cout << i << "= " << t[i] << endl;
			}
			long long long int sum = 1;
			for(int i = 1; i < M; ++i) {
				sum = sum * t[d[i] - 2];
				//cout << t[d[i] - 2] << endl;
				sum = sum % 1000000007;
			}
			sum = sum * t[d[0]] * t[d[M] - 1];
			cout << sum % 1000000007 << endl;
		}
	}
}
	
