#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<bool> broken(N + 100, false);
  for (int i = 0; i < M; i++) {
    int n;
    cin >> n;
    broken.at(n) = true;
  }
  vector<long long> DP(N + 100, 0);
  DP.at(0) = 1;
  for (int i = 0; i <= N; i++) {
    if (broken.at(i + 1) == false) {
      DP.at(i + 1) += (DP.at(i) % 1000000007);
    }
    if (broken.at(i + 2) == false) {
      DP.at(i + 2) += (DP.at(i) % 1000000007);
    }
  }
  cout << DP.at(N) << endl;
}
