#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t dp[100000];
  dp[0] = 1;
  dp[1] = 1;
  dp[2] = 2;
  for (int i = 1; i < 100000; i++) {
    dp[i + 2] = dp[i] % 1000000007 + dp[i + 1] % 1000000007;
  }
  int N;
  cin >> N;
  int M;
  cin >> M;
  vector<int> sd(M);
  int c = 1;
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    sd.at(i) = a;
    if (i > 0 && sd.at(i) - sd.at(i - 1) == 1) {
      c = 0;
    }
  }
  if (c == 0)
    cout << 0;
  else {
    int64_t g = 1;
    for (int i = 0; i < M + 1; i++) {
      if (i == M) g = g * dp[N - sd.at(M - 1) - 1] % 1000000007;
      if (i == M - 1)
        g = g * dp[sd.at(0) - 1];
      else if (i < M - 1)
        g = g * dp[sd.at(i + 1) - sd.at(i) - 2] % 1000000007;
    }
    cout << g << endl;
  }
}
