#include <array>
#include <iostream>

const int MAX_N_INDEX = 100000 + 1; // 10^5
std::array<int, MAX_N_INDEX> dp;

const int MAX_M = MAX_N_INDEX - 1;
std::array<int, MAX_M> broken_stair;

const int MOD_UNIT = 1'000'000'007;

int main()
{
	int N, M;
	std::cin >> N >> M;

	for (int i = 0; i < M; i++) {
		int index;
		std::cin >> index;
		broken_stair[index] = true;
	}

	dp[0] = 1;
	dp[1] = broken_stair[1] ? 0 : 1;
	for (int i = 2; i <= N; i++) {
		if (broken_stair[i]) {
			dp[i] = 0;
		} else {
			dp[i] = (dp[i - 1] + dp[i - 2]) % MOD_UNIT;
		}
	}
	printf("%d\n", dp[N]);
}
