#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
void Main() {
  ll N, M;
  cin >> N >> M;
  set<ll> a;
  for (ll i = 0; i < (ll)(M); i++) {
    int tmp;
    cin >> tmp;
    a.insert(tmp);
  }
  vector<ll> dp(N + 1, 0);
  dp.at(0) = 1;
  for (ll i = 1; i < (ll)(N + 1); i++) {
    if ((i - 2 >= 0) && (a.find(i - 2) == a.end())) {
      dp.at(i) += dp.at(i - 2);
    }
    if ((i - 1 >= 0) && (a.find(i - 1) == a.end())) {
      dp.at(i) += dp.at(i - 1);
    }
  }
  cout << dp.at(N) % MOD << endl;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
  return 0;
}
