#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>



int main() {
	int N, M;
	scanf("%d %d", &N, &M);
	int* b = new int[N + 1];
	for (int i = 0; i < N + 1; i++) {
		b[i] = 1;
	}
	for (int i = 0; i < M; i++) {
		int a;
		scanf_s("%d", &a);
		b[a] = 0;
	}
	long long* n = new long long[N + 1];
	n[0] = 1;
	n[1] = b[1];
	for (int i = 2; i < N + 1; i++) {
		n[i] = b[i] * (n[i - 1] + n[i - 2]);
	}
	int res = n[N] % 1000000007;
	printf("%d", res);
}

