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