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