#include <bits/stdc++.h>
using namespace std;
constexpr uint64_t kMod = 1000000007;
vector<uint64_t> memo{1, 2};
uint64_t F(uint64_t sa) {
  if (memo.size() >= sa) {
    return memo[sa - 1];
  } else {
    for (uint64_t i = memo.size(); i < sa; i++) {
      memo.emplace_back(memo[i - 1] + memo[i - 2]);
    }
    return memo[sa - 1];
  }
}
int main() {
  uint64_t N, M;
  cin >> N >> M;
  if (N == 2 && M == 1) {
    cout << 1 << endl;
    return 0;
  }
  vector<uint64_t> A;
  uint64_t before_a = kMod * 100;
  for (uint64_t i = 0; i < M; i++) {
    uint64_t a;
    cin >> a;
    if (a == before_a + 1) {
      cout << 0 << endl;
      return 0;
    }
    before_a = a;
    A.emplace_back(a);
  }
  uint64_t result = 1;
  uint64_t begin = 0;
  for (uint64_t i = 0; i < M; i++) {
    if (A[i] - begin == 1) {
      result = (result * 1) % kMod;
    } else {
      result = (result * F(A[i] - 1 - begin)) % kMod;
    }
    begin = A[i] + 1;
  }
  result = (result * F(N - begin)) % kMod;
  cout << (result % kMod) << endl;
  return 0;
}
