#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;
const ll MOD = 1000000007;

bool isin(int n, vector<int> a){
	int sz = a.size();
  	rep(i,sz){
		if(n == a[i]){return true;} 
    }
	return false;
}

void Main()
{
	int N, M;
  	cin >> N >> M;
  	vector<int> a(M);
  	rep(i,M) cin >> a[i];
  	
  	vector<ll> dp(N+5);
  	dp[0] = 1;
  	if(!isin(1,a)) dp[1] = 1;
  	else dp[1] = 0;
  
  	rep(i,N-1){
		if(!isin(i+2,a)) dp[i+2] = (dp[i+1] + dp[i])%MOD;
  		else dp[i+2] = 0;
    }
  	//rep(i,N+1) {
	//	cout << i << ": " << dp[i] << ": " << isin(i,a) << endl;
    //}
  	cout << dp[N] << endl;
  	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}