#include <iostream>
#include<math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


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

	int a[100010];
	for (int i = 0; i < M; i++)cin >> a[i];

	int dp[100010] = {0};
	
	dp[0] = 0;
	dp[1] = dp[0] + abs(dp[1] + dp[0]);
	
	for (int i = 2; i < (int)(N); i++) {
		for (int j = i; j < M; j++) {
			if (i == a[j])dp[i] = 0;
			else dp[i] = dp[i - 1] + dp[i - 2];
		}

 cout << dp[N-1]%1000000007 << endl;
} 