#include <bits/stdc++.h>
using ll = long long;
using itn = int;
using namespace std;
int GCD(int a, int b) {
	return b ? GCD(b, a%b) : a;
}
//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

int main() {
	int n, m;
	cin >> n >> m;
	int a[m];
	for (int i = 0; i<m; i++) cin >> a[i];

	ll steps[n + 1] = { 0 };
	steps[n] = 1;
	steps[n - 1] = 1;
	int p = m - 1;
	for (int i = n - 2; i >= 0; i--) {
		if (p >= 0 && i == a[p]) {
			p--;
			continue;
		}
		 steps[i] = (steps[i + 1] + steps[i + 2]) % 1000000007;
	}
	cout << steps[0] << endl;

}