#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long N, M, tmp;
  long long data[100000] = {0};
  std::cin >> N >> M;
  data[N] = 1;
  for (int i = 0; i < M; i++) {
    std::cin >> tmp;
    data[tmp] = -1;
  }
  if (data[0] == -1) {
    std::cout << "0" << '\n';
    return 0;
  }
  for (int i = N - 1; i >= 0; i--) {
    if (data[i] != -1) {
      if (data[i + 1] != -1) data[i] += data[i + 1];
      if (data[i + 2] != -1) data[i] += data[i + 2];
    }
    data[i] %= 1000000007;
  }
  std::cout << data[0] << '\n';
}
