#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
long long mod = 1000000007;
int main(){
	long long n,m; cin >> n >> m;
	vector<bool> av = vector<bool>(m+10, false);
	for(long long i = 0; i < m; i++){
		long long a; cin >> a;
		av[a] = true; 
	}

	long long dp[n+10];
	dp[0] = 1;
	if(!av[1])dp[1] = 1;
	else dp[1] = 0;

	for(long longi = 2; i < n+1; i++){
		if(av[i]) dp[i] = 0;
		else dp[i] = dp[i - 1] + dp[i - 2];
		//cout << i << ": "<< dp[i] << endl;
	}
	cout << dp[n]%mod << endl;
}	