#include <bits/stdc++.h>
using namespace std;
int64_t const MAX = pow(10, 9) + 7;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  vector<bool> b(N + 1);
  for (int i = 0; i < M; ++i) {
    cin >> a.at(i);
    b.at(a.at(i)) = b.at(a.at(i)) + 1;
  }
  vector<int64_t> dp(N + 1);
  for (int i = N; i >= 0; --i) {
    if (i == N) {
      dp.at(N) = 1;
    } else if (i == N - 1) {
      if (b.at(N - 1) == 1) {
        dp.at(N - 1) = 0;
      } else {
        dp.at(N - 1) = 1;
      }
    } else {
      if (b.at(i) == 1) {
        dp.at(i) = 0;
      } else {
        dp.at(i) = dp.at(i + 1) + dp.at(i + 2) % MAX;
      }
    }
  }
  cout << dp.at(0) << endl;
}
