#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
int main() {
  ll i, n, m;
  cin >> n >> m;
  ll a[m], b[n + 1];
  for (i = 0; i < m; i++) {
    cin >> a[i];
  }
  b[0] = 1;
  b[1] = 1;
  ll step = 0;
  if (a[step] == 1) {
    b[1] = 0;
    step++;
  }
  for (i = 2; i < n + 1; i++) {
    if (i == a[step]) {
      b[i] = 0;
      step++;
    } else {
      b[i] = b[i - 1] + b[i - 2];
    }
  }
  ll ans = b[n] % mod;
  cout << ans << endl;
  return 0;
}
