#include <bits/stdc++.h>
using namespace std;
int main() {
  long long steps[1000001];
  long long N, M;
  cin >> N >> M;
  bool a[N];
  for (int i = 0; i < N; i++) {
    a[i] = false;
  }
  int broken;
  for (int i = 0; i < M; i++) {
    if (cin >> broken)
      a[broken] = true;
    else
      a[i] = false;
    if (i > 1 && a[broken] == true && a[broken - 1] == true) {
      cout << 0 << endl;
      return 0;
    }
  }
  steps[0] = 0;
  steps[1] = 1;
  steps[2] = 2;
  for (int i = 0; i < N + 1; i++) {
    if (i == 0 && a[i] == true) {
      steps[1] = 0;
      steps[2] = 1;
    }
    if (a[i] == true && i == 1) {
      steps[2] = 1;
      steps[3] = 2;
      i += 3;
    }
    if (a[i] == true && i == 2) {
      steps[3] = steps[1];
      steps[4] = steps[3];
      steps[5] = steps[3] + steps[4];
    }
    if (i >= 3) {
      if (a[i] == true) {
        steps[i + 1] = steps[i - 1];
        steps[i + 2] = steps[i + 1];
        i += 2;
      } else {
        steps[i] = steps[i - 1] + steps[i - 2];
      }
    }
    if (steps[i] > 1000000007) steps[i] %= 1000000007;
  }
  cout << steps[N] % 1000000007 << endl;
}
