#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
map<ll, ll> memo;
ll fib(ll a) {
  if (memo[a] != 0) return memo[a];
  memo[a] = fib(a - 1) + fib(a - 2);
  return memo[a];
}
int main() {
  memo[0] = 1;
  memo[1] = 1;
  int N, M;
  cin >> N >> M;
  vector<int> A(M + 1);
  for (int i = 0; i < ((int)(M)); i++) {
    cin >> A.at(i);
    if (i > 0 && A[i] == A[i - 1] + 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  A.at(M) = N;
  ll MOD = 1000000007;
  ll res = 1;
  for (int i = 0; i < ((int)(M + 1)); i++) {
    ll a = A[i];
    if (i > 0) a -= A[i - 1] + 1;
    if (i != M) a--;
    res *= fib(a);
    res %= MOD;
  }
  cout << res << endl;
}
