#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()
#define MOD 1000000007
using namespace std;

int main(){
	int N,M;
	cin >>N>>M;
	bool a[N]={};
	ll dp[N+1] = {};
	rep(i,0,M){
		int tmp;
		cin >> tmp;
		a[tmp] = true;
	}	
	dp[0] = 1;
	rep(i,0,N){
		rep(j,i+1,min(N+1,i+3)){
			if(!a[j]){
				dp[j] += dp[i];
				dp[j] = dp[j] % MOD;
			}
		}
	}
	cout << dp[N] << endl;
}
