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

int main()
{
	/*#ifndef ONLINE_JUDGE
		freopen("in.txt","r",stdin);
		freopen("out.txt","w",stdout);
	#endif*/
	ios_base::sync_with_stdio(false);
   	cin.tie(NULL);
   	ll N,M; cin >> N >> M;
   	vector<bool> broken(N+1, true);

   	for (int i = 0; i < M; ++i)
   	{
   		ll a; cin >> a;
   		broken[a] = false;
   	}

	ll pasos = 1;
   	ll p = 0;

   	for (ll i = 1; i < N+1; ++i)
   	{
   		if (!broken[i] and !broken[i-1])
   		{
   			pasos = 0;
   			break;
   		}
   		if (broken[i] and broken[i-1] and (i > 1 and broken[i-2]))
   		{
   			ll aux = pasos;
   			pasos = (pasos + p) % 1000000007;
   			p = aux;
   		}
   		else if (i==1 and broken[i])
   		{
   			ll aux = pasos;
   			pasos = (pasos + p) % 1000000007;
   			p = aux;
   		}
   		else
   		{
   			p = pasos;
   		}
   	}

   	cout << pasos%1000000007 << '\n';



	return 0;	
}
