#include <bits/stdc++.h>
using namespace std;
int main() {
  const int64_t l = 1000000007;
  int64_t n, m;
  cin >> n >> m;
  queue<int64_t> a;
  int64_t aa;
  for (int64_t i = 0; i < m; i++) {
    cin >> aa;
    a.push(aa);
  }
  vector<int64_t> p(n + 1, 1);
  p.at(0) = 1;
  p.at(1) = 1;
  p.at(2) = 2;
  for (int i = 0; i < m; i++) {
    p.at(a.front()) = 0;
    a.pop();
  }
  for (int64_t i = 0; i < n - 1; i++) {
    if (p.at(i + 2) != 0) {
      p.at(i + 2) = (p.at(i + 1) + p.at(i)) % l;
    }
  }
  cout << p.at(n) << endl;
}
