#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 + 5];
  for (int i = 0; i < N + 5; i++) ans[i] = 0;
  ans[0] = 1;
  for (int i = 0; i < N + 3; i++) {
    if (i == a.front()) {
      a.pop();
      ans[i] = 0;
    }
    ans[i + 1] = (ans[i + 1] + ans[i]) % Mod;
    ans[i + 2] = (ans[i + 2] + ans[i]) % Mod;
  }
  cout << ans[N] << endl;
  return 0;
}
