
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
using namespace std;
ll INF = 1001001001;
ll DIV = 1000000007;


	

int main(){
	vector<ll> dp(100001);
	dp[0]=1;
	dp[1]=1;

	for(int i=2; i<=100000; i++){
		dp[i]=dp[i-2]+dp[i-1];
	}


	int n,m;
	cin >> n >> m;
	vector<int> a(n);
	rep(i,m){
		cin >> a[i];
		if(i>=1){
			if(a[i]-a[i-1] == 1){
				cout << 0 << endl;
				return 0;
			}
		}
	}
	ll res=1;
	int before = 0;
	int after = n;
	rep(i,m+1){
		if(i==m){ after=n;
		}else{ after=a[i]-1;
		}

		int c = after-before;
		ll tmp = dp[c];
		res = res * tmp;
		before = after+2;
	}
	res = res%DIV;
	cout << res << endl;
	return 0;
}