#include <bits/stdc++.h>
using namespace std;
long long Mod = pow(10, 9) + 7;
int main() {
  int N, M;
  cin >> N >> M;
  queue<int> a;
  for (int i = 0; i < M; i++) {
    int s;
    cin >> s;
    a.push(s);
  }
  long long ans[N + 3];
  for (int i = 0; i < N + 3; i++) ans[i] = 0;
  ans[0] = 1;
  for (int i = 0; i < N; i++) {
    if (i == a.front()) {
      a.pop();
      ans[i] = 0;
    }
    ans[i + 1] += ans[i];
    ans[i + 1] = ans[i + 1] % Mod;
    ans[i + 2] += ans[i];
    ans[i + 2] = ans[i + 2] % Mod;
  }
  cout << ans[N] << endl;
  return 0;
}
