#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  ll mod = 1e9 + 7;
  vector<ll> a(n), s(n + 1);
  for (int i = 0; i < (m); i++) cin >> a[i];
  int l = 0;
  s[0] = 1;
  for (int i = 0; i < (n + 1); i++) {
    if (a[l] == i) {
      s[i] = 0;
      l++;
      continue;
    }
    if (i >= 2)
      s[i] += s[i - 1] + s[i - 2];
    else if (i == 1)
      s[1] += s[0];
    s[i] %= mod;
  }
  cout << s[n] % mod << endl;
  return 0;
}
