#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  int M;
  cin >> M;
  vector<long long> steps(N, 0);
  vector<bool> notBreaked(N, true);
  int a;
  for (int i = 0; i < M; i++) {
    cin >> a;
    notBreaked[a - 1] = false;
  }
  steps[0] = 1;
  steps[1] = 2;
  for (int i = 2; i < N; i++) {
    if (notBreaked[i - 1]) steps[i] += steps[i - 1];
    if (notBreaked[i - 2]) steps[i] += steps[i - 2];
    steps[i] = (steps[i] % 1000000007);
  }
  cout << steps[N - 1] << endl;
}
