#include <bits/stdc++.h>
int64_t kRem = 1000000007;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<int> blocks(m);
  for (auto& block : blocks) {
    cin >> block;
  }
  vector<int64_t> scores(n + 1);
  scores[0] = 1;
  auto it = blocks.begin();
  if (*it == 1) {
    scores[1] = 0;
    it++;
  } else {
    scores[1] = 1;
  }
  for (int i = 2; i <= n; i++) {
    if (it != blocks.end() && *it == i) {
      scores[i] = 0;
      it++;
      continue;
    }
    scores[i] = scores[i - 1] + scores[i - 2];
    scores[i] %= kRem;
  }
  cout << scores[n] << endl;
  return 0;
}
