#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
using namespace std;

using INT = long long;
using UINT = unsigned long long;

unsigned gcd(unsigned a, unsigned b) {
	while (1) {
		if (a < b) swap(a, b);
		if (!b) break;
		a %= b;
	}
	return a;
}

INT dp[10010];
bool br[10010] = { false };

int main()
{
	int n, m;
	cin >> n >> m;

	for (size_t i = 0; i < m; i++)
	{
		int a;
		cin >> a;
		br[a] = true;
	}

	dp[0] = 1;
	dp[1] = 1;
	for (size_t i = 2; i <= n; i++)
	{
		dp[i] = (!br[i - 2] ? dp[i - 2] : 0) + (!br[i - 1] ? dp[i - 1] : 0);
		dp[i] %= 1000000007;
	}

	cout << dp[n] << endl;
}
