#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long ll;

const int maxn = 5e8;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;

int read()
{
	int x;
	scanf("%d", &x);
	return x;
}

int n, m, a[maxn], dp[maxn];
bool b[maxn];

bool cmp(int x, int y)
{
	return x > y;
}

int main()
{
	n = read(), m = read();
	for(int i = 1; i <= m; i ++)
	{
		a[i] = read();
	}
	dp[1] = 1, dp[2] = 2;
	for(int i = 1; i <= m; i ++)
	{
		b[a[i]] = true;
	} 
	if(b[1] == true)
	{
		dp[1] = 0;
		dp[2] = 1;
	}
	if(b[2] == true)
	{
		dp[2] = 0;
	}
	for(int i = 3; i <= n; i ++)
	{
		if(b[i])
		{
			dp[i] = 0;
		}
		else
		{
			dp[i] = dp[i - 1] + dp[i - 2];
			dp[i] %= mod;
		}
	}
	cout << (dp[n] + mod) % mod;
	return 0;
}