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