#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define ll long long
#define be(v) v.begin(), v.end()
#define dcout cout << fixed << setprecision(20) 
ll INF = 1000100100010;
ll mod = 1e9 + 7;

template<class T> inline void chmin(T& a,T b) {   //DP(小)
    if(a>b) a = b; 
} 
template<class T> inline void chmax(T& a,T b) {   //DP(大)
    if(a<b) a = b; 
} 
int main() {
	int n,m; cin >> n >> m;
	vector<int> oks(n+1,true);
	ll dp(n+1){};
	rep(i,m) {
		int a;
		cin >> a;
		oks[a] = false;
	}
	rep(i,n+1) dp[i] = 1;
	for(int now = 0;now<m;now++) {
		for(int next = now + 1; next<=min(now+2,n)) {
			if(oks[next]) {
				dp[next] += dp[now];
				dp[next] %= mod;
			}
		}
	}
	cout << dp[n] << endl;
}