#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main ()
{
	int n, m;
  	cin >> n >> m;
  	ll dp[100010];
  	vector<ll> broken(100010,true);
  	for(int i = 0; i < m; i++)
    {
    	int a;
      	cin >> a;
      	broken[a] = false;
    }
  	dp[0] = 1;
  	for(int i = 0; i < n; i++)
    {
    	for(int j = i + 1; j <=min(n, i+2); j++)
        {
        	if(broken[j])
            {
            	dp[j] += dp[i];
              	dp[j] %= 1e7;
            }
        } 
    }
  	cout << dp[n] << endl;
  	return 0;
}
