#include <bits/stdc++.h>
using namespace std;
void show() {}
template <class Head, class... Args>
void show(Head t, Args... args) {
  std::cout << t << " ";
  show(args...);
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N + 10, 0);
  vector<long long> w(N + 10, -1);
  w[1] = 1;
  w[2] = 2;
  for (long long i = 1; i <= M; i++) {
    cin >> a[i];
    w[a[i]] = 0;
  }
  if (w[1] == 0) w[2] = 1;
  for (long long i = 3; i <= N; i++) {
    if (w[i] == -1) {
      w[i] = (w[i - 1] + w[i - 2]) % 1000000007;
    };
  }
  cout << w[N];
  return 0;
}
