#include<iostream>
#include <vector>
#include<algorithm>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define vsort(v) sort(v.begin(),v,end())
#define ll long long
const ll MOD = 1e9 + 7;

int main() {
	int n, m;
	cin >> n >> m;
	vector<bool> b(n + 1);
	rep(i, m) {
		int a;
		cin >> a;
		b[a] = 1;
	}

	vector<ll> dp(n + 1);
	dp[0] = 1;
	if (b[1]) dp[1] = 0;
	else dp[1] = 1;

	for (int i = 2; i <= n; i++) {
		if (!b[i]) dp[i] = dp[i - 1] + dp[i - 2];
		else dp[i] = 0;
		dp[i] %= mod;
	}
	cout << dp[n] << endl;
}
