#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
class mll {
 public:
  long long x;
  mll(long long x = 0) : x((x % M + M) % M){};
  void operator+=(const mll& a) {
    if ((x += a.x) >= M) x -= M;
  }
  void operator*=(const mll& a) { (x *= a.x) %= M; }
  mll operator+(const mll& a) const {
    mll ans = *this;
    ans += a;
    return ans;
  }
};
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i = 0; i < M; i++) cin >> A[i];
  vector<int> B(M + 1);
  B[0] = (M > 1 ? A[0] : N + 1);
  int BMAX = B[0];
  for (int i = 1; i < M; i++) {
    B[i] = A[i] - A[i - 1] - 1;
    if (B[i] == 0) {
      cout << 0 << endl;
      return 0;
    }
    BMAX = max(B[i], BMAX);
  }
  if (M > 1) {
    B[M] = N - A[M - 1];
    BMAX = max(B[M], BMAX);
  }
  vector<mll> fib(BMAX + 1, 0);
  for (int i = 1; i <= BMAX; i++) {
    if (i == 1 || i == 2)
      fib[i] = mll(1);
    else
      fib[i] = fib[i - 1] + fib[i - 2];
  }
  mll ans = 1;
  for (int b : B) ans *= fib[b];
  cout << ans.x << endl;
}
