#include <bits/stdc++.h>
using namespace std;

int mod = 1000000007;
int n_max = 100000;
int f[n_max + 1];
void intiF() {
	f[0] = 1;
	f[1] = 1;
	for (int i = 2; i < n_max + 1; i++) {
		f[i] = f[i - 1] + f[i - 2];
	}
}

int main() {
	intiF();
	int n, m;
	cin >> n >> m;
	long long result = 1;
	int x = 0;
	for (int i = 0, a; i < m; i++) {
		cin >> a;
		if (x == a) {
			cout << 0 << endl;
			return 0;
		}
		result = result * f[a - 1 - x] % mod;
		x = a + 1;
	}

	cout << result * f[n - x] % mod << endl;
}
