#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, m;
  cin >> n >> m;
  priority_queue<int, vector<int>, greater<int>> a;
  vector<long long unsigned int> ret;
  int ai, i;
  for (i = 0; i < m; i++) {
    cin >> ai;
    a.push(ai);
  }
  int danger;
  if (!a.empty()) {
    danger = a.top();
    a.pop();
  } else {
    danger = -1;
  }
  for (i = 0; i < n + 1; i++) {
    if (i == danger) {
      ret.push_back(0);
      if (!a.empty()) {
        danger = a.top();
        a.pop();
      } else {
        danger = -1;
      }
    } else {
      if (i == 0) {
        ret.push_back(1);
      } else if (i == 1) {
        ret.push_back(1);
      } else {
        ret.push_back(ret[i - 1] + ret[i - 2]);
      }
    }
  }
  cout << (ret[n] % 1000000007) << endl;
  return 0;
}
