#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> enter(M);
  for (int i = 0; i < M; i++) {
    cin >> enter.at(i);
  }
  vector<int> broken(N + 1);
  for (int i = 0; i < N + 1; i++) {
    if (enter.at(i) == i)
      broken.at(i) = 1;
    else
      broken.at(i) = 0;
  }
  vector<int> dp(N + 1);
  dp.at(0) = 0;
  if (broken.at(1) = 1)
    dp.at(1) = 0;
  else
    dp.at(1) = 1;
  for (int i = 2; i < N + 1; i++) {
    if (broken.at(i) == 1)
      dp.at(i) = 0;
    else
      dp.at(i) = dp.at(i - 1) % 100000007 + dp.at(i - 2) % 100000007;
  }
  cout << dp.at(N) % 100000007;
}
