#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;
  }
};
mll fib(int k, vector<mll>& memo) {
  if (k == 1 || k == 2) return mll(1);
  if (memo[k].x > 0) return memo[k];
  memo[k] = fib(k - 1, memo) + fib(k - 2, memo);
  return memo[k];
}
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] = A[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;
    }
  }
  B[M] = N - A[M - 1];
  mll ans = 1;
  vector<mll> memo(N, 0);
  for (int b : B) ans *= fib(b, memo);
  cout << ans.x << endl;
}
