#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
const long long inf = 1e9;
const int MAX = 1e5 + 5;
const long long MOD = 1e9 + 7;
struct edge {
  int to;
  int cost;
};
using graph = vector<vector<edge>>;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> step(n + 1, 0);
  step[0] = 1;
  priority_queue<int, vector<int>, greater<int>> p;
  int tmp;
  for (int i = 0; i < (m); ++i) {
    cin >> tmp;
    p.push(tmp);
  }
  tmp = p.top();
  p.pop();
  if (tmp == 1) {
    step[1] = 0;
    tmp = p.top();
    p.pop();
  } else
    step[1] = 1;
  for (int i = 2; i < n; i++) {
    if (i == tmp) {
      step[i] = 0;
      tmp = p.top();
      p.pop();
    } else {
      step[i] = step[i - 1] + step[i - 2];
      step[i] %= MOD;
    }
  }
  long long ans = (step[n - 1] + step[n - 2]) % MOD;
  cout << ans << endl;
  return 0;
}
