#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL //デバッグ出力系
#define dout cout
#define debug() if(true)
#else
#define dout(s) if(false) cout
#define debug() if(false)
#endif//
#define next asdnext
#define prev asdprev
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define vout(v) for(auto &i:v){cout<<i<<" ";}cout<<"\n"; //配列出力
#define vin(v) for(auto &i:v)cin>>i; //配列入力
#define vec(v,n) vector<int> v(n,0);
typedef long long ll;
typedef unsigned long long ull;

void Main() {
	int N, M;
	cin >> N >> M;
	vec(a,M);
	vin(a);

	vec(dp, N+2);
	dp[N] = 1;
	int index = M-1;
	for (int i = N - 1; i >= 0; i--) {
		if (i == a[index]) {
			if (index != 0) index--;
			dp[i] = 0;
			continue;
		}
		dp[i] = (dp[i + 1] + dp[i + 2]) % 1000000007;
		dout << i << ":" << dp[i] << "\n";
	}

	cout << (dp[0] % 1000000007) << endl;
}

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