#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, denger_id;
  vector<int> a;
  vector<long long int> step;
  cin >> n >> m;
  a.resize(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  step.resize(n + 100);
  for (int i = 0; i < n + 1; i++) {
    step[i] = 0;
  }
  step[0] = 1;
  denger_id = 0;
  if (a[denger_id] == 1) {
    step[1] = 0;
    denger_id++;
  } else {
    step[1] = 1;
  }
  for (int i = 2; i < n + 1; i++) {
    if (i == a[denger_id]) {
      denger_id++;
    } else {
      step[i] = (step[i - 1] + step[i - 2]) % 1000000007;
    }
  }
  cout << step[n] % 1000000007 << endl;
  return 0;
}
