#include <bits/stdc++.h>
using namespace std;
std::vector<bool> stiustir;
std::vector<long long> recordstepstir;
int N = 0;
void search(int now) {
  long long step = 0;
  if (stiustir[now] == false) {
    recordstepstir[now] = 0;
    search(now - 1);
    return;
  }
  if (now > 0 && now <= N - 2) {
    step += recordstepstir[now + 2];
    step += recordstepstir[now + 1];
    recordstepstir[now] = step % 1000000007;
    search(now - 1);
  } else if (now == N - 1) {
    recordstepstir[now] = 1;
    search(now - 1);
    return;
  } else if (now == 0) {
    step += recordstepstir[now + 2];
    step += recordstepstir[now + 1];
    recordstepstir[now] = step % 1000000007;
    cout << (step % 1000000007);
    return;
  }
  return;
}
int main(void) {
  int i, j, k, M;
  cin >> N >> M;
  int a[M];
  for (i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (i = 0; i < N; i++) {
    stiustir.push_back(true);
    recordstepstir.push_back(0);
  }
  recordstepstir.push_back(1);
  stiustir.push_back(true);
  for (i = 0; i < M; i++) {
    stiustir[a[i]] = false;
  }
  search(N - 1);
  return 0;
}
