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