#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> b(M + 2);
  b.at(M) = 0;
  for (int i = 0; i < M; i++) {
    cin >> b.at(i);
  }
  vector<long long> a(N);
  bool g = false;
  for (int i = 0; i < M; i++) {
    if (b.at(i) == 1) {
      g = true;
      a.at(0) = 0;
      a.at(1) = 1;
    }
    if (b.at(i) == 2) {
      if (g) {
        a.at(N - 1) = 0;
        break;
      } else
        a.at(1) = 0;
    }
  }
  for (int i = 2; i < N; i++) {
    bool h = false;
    for (int j = 0; j < M; j++) {
      if (i == b.at(j) - 1) {
        a.at(i) = 0;
        h = true;
      }
    }
    if (!h) a.at(i) = a.at(i - 1) + a.at(i - 2);
  }
  cout << a.at(N - 1) % 1000000007 << endl;
}
