# include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m, temp;
  	cin >> n >> m;
  	int broken[n+1] = {0}
	for (int i =0; i < m; i++){
    	cin >> temp;
      	broken[temp] = 1;
    }
  	long int dp[n+1] = {0};
  	dp[0] = 1;
  	(broken[1]==0)? dp[1] = 1 : dp[1] = 0;
  	for (int i = 2; i < n+1; i++){
    	if(!broken[i]) dp[i] = (dp[i-1]%1000000007 + dp[i-2]%1000000007)%1000000007;
    }
  
  cout << dp[n]<<'\n';
	return 0;
}