#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long maxn = 1000000000;
using vi = vector<int>;
using vll = vector<long long>;
using vvi = vector<vi>;
using vs = vector<string>;
using pll = pair<long long, long long>;
int main() {
  long long n, m;
  cin >> n >> m;
  vll a(n - 1);
  for (int(i) = 0; (i) < (m); (i)++) cin >> a.at(i + 1);
  vll dp(n + 1);
  long long k = 1;
  dp.at(0) = 1;
  if (a.at(k) == 1) {
    dp.at(1) = 0;
    k++;
  } else
    dp.at(1) = 1;
  for (int i = 2; i <= n; i++) {
    if (a.at(k) == i) {
      dp.at(i) = 0;
      k++;
    } else {
      dp.at(i) = dp.at(i - 1) + dp.at(i - 2);
      dp.at(i) %= mod;
    }
  }
  cout << dp.at(n) << endl;
}
