#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, M, step2down = 1, step1down = 1, brokepoint = 0;
  cin >> N >> M;
  vector<int64_t> A(M);
  vector<int64_t> mem(100001, 0);
  for (int i = 0; i < M; i++) {
    cin >> A[i];
    if (i > 0) {
      if (A[i] - A[i - 1] == 1) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  if (A[0] == 1) {
    mem[1] = 0;
    brokepoint++;
  } else
    mem[1] = 1;
  mem[0] = 1;
  for (int i = 1; i < N; i++) {
    if (A[brokepoint] == i + 1) {
      mem[i + 1] = 0;
      if (brokepoint < M - 1) brokepoint++;
    } else
      mem[i + 1] = mem[i] + mem[i - 1];
    mem[i + 1] %= 1000000007;
  }
  cout << mem[N] << endl;
}
