#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  long long M;
  cin >> M;
  vector<bool> a(N);
  vector<long long> s(N + 1);
  for (long long j = 0; j < M; ++j) {
    long long a_i;
    cin >> a_i;
    a[a_i] = true;
  }
  long long acc = 0;
  s[0] = 1;
  s[1] = 1;
  for (long long j = 2; j < N + 1; ++j) {
    s[j] += !a[j - 1] ? s[j - 1] : 0;
    s[j] += !a[j - 2] ? s[j - 2] : 0;
  }
  cout << s[N] % 1000000007 << endl;
  return 0;
}
