#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, M;
  cin >> N >> M;
  long long int tmp;
  vector<long long int> a;
  for (int i = 0; i < M; i++) {
    cin >> tmp;
    a.push_back(tmp);
  }
  vector<long long int> S(1001000);
  S[0] = 1;
  int j = 0;
  if (a[0] == 1) {
    S[1] = 0;
    j++;
  } else {
    S[1] = 1;
  }
  for (int i = 2; i <= N; i++) {
    if (j < M && i == a[j]) {
      S[i] = 0;
      j++;
    } else {
      S[i] = S[i - 1] + S[i - 2];
      S[i] %= 1000000007;
    }
  }
  cout << S[N] << endl;
  return 0;
}
