#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  vector<int> a(m);
  int i;
  for (i = 0; i < m; ++i) {
    cin >> a.at(i);
  }
  vector<long long> b(n);
  b.at(0) = 1;
  int k = 0;
  if (k != m) {
    if (a.at(k) == 1) {
      ++k;
      b.at(1) = 0;
    } else {
      b.at(1) = 1;
    }
  }
  long long t = 1e9 + 7;
  for (i = 2; i < n; ++i) {
    if (k == m) {
      b.at(i) = (b.at(i - 1) % t + b.at(i - 2) % t) % t;
    } else {
      if (a.at(k) == i) {
        b.at(i) = 0;
        ++k;
      } else {
        b.at(i) = (b.at(i - 1) % t + b.at(i - 2) % t) % t;
      }
    }
  }
  cout << (b.at(n - 1) % t + b.at(n - 2) % t) % t << endl;
  return 0;
}
