#include <bits/stdc++.h>
using namespace std;
const long long mod = 10e9 + 7;

int main(){
	long long N, M;
	cin >> N >> M;
	vector<long long> dp(N + 1);
	vector<bool> pos(N + 1, true);
	for(int i = 0; i < M; i++){
		long long n;
		cin >> n;
		pos[n] = false;
	}
	
	dp[0] = 1;
	if(pos[1]){
		dp[1] = 1;
	} else {
		dp[1] = 0;
	
	for(int i = 2; i <= N; i++){
		if(pos[i]){
			dp[i] = dp[i - 1] + dp[i - 2];
			dp[i] %= mod;
		} else {
			dp[i] = 0;
		}
	}
	
	cout << dp[N] << endl;
	return 0;
}