#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v(m);
  for (int i = 0; i < m; i++) {
    cin >> v.at(i);
  }
  ll INF = 1000000007;
  vector<ll> h(n + 1, 0);
  h.at(0) = 1;
  if (v.at(0) != 1) {
    h.at(1) = 1;
  }
  for (int i = 2; i < n + 1; i++) {
    h.at(i) = h.at(i - 1) + h.at(i - 2);
    for (int j = 0; j < m; j++) {
      if (i == v.at(j)) {
        h.at(i) = 0;
      }
    }
  }
  cout << h.at(n) % INF << endl;
}
