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