#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
ll mod(ll a) { return (a % 1000000007); }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
int main() {
  ll n, m;
  cin >> n >> m;
  vl arraynum(n + 1);
  arraynum[0] = 1;
  for (int i = 0; i < (n); i++) {
    ll x;
    cin >> x;
    arraynum[x] = -1;
  }
  if (arraynum[1])
    arraynum[1] = 0;
  else
    arraynum[1] = 1;
  if (arraynum[2])
    arraynum[2] = 0;
  else
    arraynum[2] = 2;
  for (ll now = 0; now < n - 1; now++) {
    ll next = now + 1;
    ll nexnex = next + 1;
    if (arraynum[nexnex] == -1) {
      arraynum[nexnex] = 0;
      continue;
    } else {
      arraynum[nexnex] = arraynum[next] + arraynum[now];
    }
    arraynum[nexnex] = mod(arraynum[nexnex]);
  }
  cout << arraynum[n] << endl;
}
