#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
const ll MOD = 1e9+7;
// const ll MOD = 1;
// ll dp[100000];
vector<ll > dp(100000, -1);
ll cal(ll i){
  if(dp[i] >= 0){
    return dp[i ];
  }
  dp[i] = cal(i - 1) + cal(i - 2);
}
int main()
{
  ll N, M;
  cin >> N >> M;
  vector<ll > a(M);
  REP(i, M) cin >> a[i] ;
  //  memset(dp, -1, sizeof(dp));
  dp[0] = 0;
  dp[1] = 1;
  dp[2] = 2;
  ll sum = 0;
  if(a[0] == 1){sum = 1;}
  else{sum = cal(a[0] - 1);}
  // cout << "init:" << sum << endl;
  ll ind = 0;
  REP(i, M - 1){
    ind = a[i + 1] - a[i] - 1;
    sum *= cal(ind);
    // cout << "ind = " << ind << ", cal(ind) = " << cal(a[i + 1] - a[i] - 1) << endl;
    sum %= MOD;
    if(sum ==0){
      break;
    }
  }
  // cout << "final:" << N - a[M - 1] - 1 << "," <<cal(N - a[M - 1] - 1)<< endl;
  if(a[M - 1] == N - 1){sum *= 1;}
  else{sum *= cal(N - a[M - 1] - 1);}
  sum %= MOD;
  cout << sum << endl;
  // REP(i, 10){
  //   cal(i);
  //   cout << "i = " << i << ", dp = " << dp[i] << endl;
  // }
