#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;
int main() {
  ll n, m;
  cin >> n >> m;
  vector<ll> dp(n + 1);
  dp.at(1) = 1;
  dp.at(2) = 2;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a.at(i);
    dp.at(a.at(i)) = -1;
  }
  if (dp.at(1) == -1) {
    dp.at(2) = 1;
  }
  for (int i = 3; i <= n; i++) {
    if (dp.at(i) != -1) {
      if (dp.at(i - 1) != -1) {
        dp.at(i) += dp.at(i - 1);
      }
      if (i - 2 >= 0) {
        if (dp.at(i - 2) != -1) {
          dp.at(i) += dp.at(i - 2);
        }
      }
    }
  }
  cout << dp.at(n) % mod << endl;
}
