#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) { a = b; return 1; }
  return 0; }
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) { a = b; return 1; }
  return 0; }
ll MOD = 1000000007;

int main(void){
  ll n,m; cin >> n >> m;
  ll a[m];
  rep(i,m){
    cin >> a[i];
    if(i > 0 && a[i-1] + 1 == a[i]){
      cout << 0 << endl;
      return 0;
    }
  }
  ll s[100005];
  s[0] = 1;
  s[1] = 1;
  for(int i = 2; i < 100005; i++){
    s[i] = (s[i-1] + s[i-2])%MOD;
  }
  ll ans = 0;
  ans += (s[a[0]-1]);
  if(m == 0){
    ans = s[n-1]
    cout << ans << endl;
    return 0;
  }
  for(int i = 1; i < m; i++){
    if(a[i] - a[i-1] == 2) ans *= 1;
    else ans *= (s[a[i]-a[i-1]-2])%MOD;
  }
  ans *= (s[n-a[m-1]-1])%MOD;
  ans %= MOD;
  cout << ans << endl;
  return 0;
}
