#include <cmath>
#include <string.h>
#include <iostream>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <algorithm>

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep_nested(i, s, n) for (int i = s; i <= n; i++)
#define ll long long
#define ull unsigned long long

const int N = 500;
const ll INF = 1000000007;

using namespace std;

template <class T>
T limit(T n, T k) {
	return (n > k) ? k : n;
}

int main() {
	cout << cal_time_steps() << endl;
    return 0;
}

int cal_time_steps() {
	int n, m, k;
	
	cin >> n >> m;
	
	vector<ull> v(n + 1, 0);
	vector<bool> a(n + 1, true);
	
	rep(i, n) {
		cin >> k;
		a[k] = false;
	}
	
	v[0] = 1;
	
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j <= limit(n, i + 2); j++) {
			if (a[j]) {
				v[j] += v[i];
				v[j] %= INF;
			}
		}
	}
	
	return v[n];
}