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

#define INF 1000000

using namespace std;

unsigned int memo[100001];
int length = 0;

void bfib(int n) {
	bool bf = false;
	if (n == 1) {
		memo[n] = 1;
		return;
	}
	if (n == 2) {
		if (bf == true) {
			memo[n] = 1;
		}
		else {
			memo[n] = 2;
		}
		return;
	}
	else {
		memo[n] = (memo[n - 1] + memo[n - 2]) % 1000000007;
		return;
	}
}

int main(void)
{
	int n, nb, buf, before;
	n = nb = buf = before = 0;
	scanf_s("%d %d", &n, &nb);
	length = nb;
	for (int i = 0; i < nb; ++i) {
		scanf_s("%d", &buf);
		if (before + 1 == buf && i > 0) {
			cout << 0 << endl;
			return 0;
		}
		before = buf;
		memo[buf] = -1;
	}
	if (memo[1] == 4294967295) {
		memo[2] = 1;
	}
	else {
		memo[1] = 1;
		memo[2] = 2;
	}

	for (int i = 3; i <= n; ++i) {
		if (memo[i] == 4294967295) {
			memo[i + 1] = memo[i + 2] = memo[i - 1];
			i += 2;
		}
		else {
			if (memo[i - 2] == 4294967295) {
				memo[i] = memo[i - 1];
			}
			else if (memo[i - 1] == 4294967295) {
				memo[i] = memo[i - 2];
			}
			else {
				memo[i] = (memo[i - 2] + memo[i - 1]) % 1000000007;
			}
		}
	}
	cout << memo[n] << endl;

	return 0;

}