#include <bits/stdc++.h>
using namespace std;
bool exist(const vector<long long>& A, long long n) {
  return find(A.begin(), A.end(), n) != A.end();
}
int main() {
  long long N, M;
  static const long long mod = 1000000007;
  cin >> N >> M;
  vector<long long> a(N), d(N + 1);
  for (long long i = 0; i < M; i++) cin >> a[i];
  d[0] = 1;
  d[1] = (exist(a, 1) ? 0 : 1);
  for (long long i = 2; i <= N; i++)
    d[i] = (exist(a, i) ? 0 : (d[i - 1] + d[i - 2]) % mod);
  cout << d.back() << endl;
}
