#include <bits/stdc++.h>
struct P {
  long long var1;
  long long var2;
};
bool operator<(const P &one, const P &two) { return one.var1 < two.var1; };
bool operator>(const P &one, const P &two) { return one.var1 > two.var1; };
using namespace std;
vector<long long> dp(1000000, -1);
long long num_steps(long long start, long long end) {
  long long dan = end - start;
  if (dan < 0) return 0;
  if (dp[dan] > 0)
    return dp[dan];
  else {
    long long new_step = num_steps(start, end - 1) + num_steps(start, end - 2);
    dp[dan] = new_step;
    return new_step;
  }
}
signed main() {
  dp[0] = 1;
  dp[1] = 1;
  long long N, M;
  cin >> N >> M;
  long long result = 0;
  if (M > 0) {
    vector<long long> a(M);
    for (long long i = 0; i < M; i++) cin >> a[i];
    result = num_steps(0, a[0] - 1);
    for (long long i = 0; i < M - 1; i++) {
      result = result * num_steps(a[i] + 1, a[i + 1] - 1);
      result = result % 1000000007;
    }
    result = result * num_steps(a[M - 1] + 1, N);
  } else {
    result = num_steps(0, N);
  }
  cout << result % 1000000007 << endl;
}
