#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0;i < (int)(n);i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n);i++)
#define ALL(vec)  (vec).begin(),(vec).end()
#define lli long long int
#define pi 3.1415926535897932384626433832795
#define MAX_INF 9223372036854775807
#define MIN_INF 9223372036854775807+1
#define sosuu 1000000007


double fib(lli n) {
	double f = (pow((1 + sqrt(5)) / 2, n+1) - pow((1 - sqrt(5)) / 2, n+1)) / sqrt(5);
	return llround(f); // 四捨五入
}

int main()
{
	lli N, M;
	cin >> N >> M;
	vector<int> broken(M);
	rep(i, M)
		cin >> broken[i];
	lli ans = 1;
	if (M >= 2) {
		rep(i, M - 1) {
			ans *= fib(broken[0] + 1);
			if (broken[i + 1] - broken[i] == 1) {
				cout << 0 << endl;
				return 0;
			}
			else
				ans *= fib(broken[i + 1] - broken[i]-1)%sosuu;
		}
		ans *= fib(N - broken[M - 1]-1)%sosuu;
	}
	else if (M == 1) {
		ans *= fib(broken[0]-1)%sosuu;
		ans *= fib(N - broken[M - 1]-1)%sosuu;
	}
	else
		ans *= fib(N)%sosuu;
	cout << ans%sosuu << endl;

}