#include <bits/stdc++.h>
using ll = long long;
using pii = std::pair<ll, ll>;
using namespace std;
template <class T>
T chmin(T& a, T b) {
  if (a > b) {
    a ^= b;
    b ^= a;
    a ^= b;
    return 1;
  }
  return 0;
}
template <class T>
T chmax(T& b, T a) {
  if (a > b) {
    a ^= b;
    b ^= a;
    a ^= b;
    return 1;
  }
  return 0;
}
template <class T>
T gcd(T a, T b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
template <class T>
vector<pair<T, T>> duplicator(const vector<T>& input) {
  vector<pair<T, T>> out(input.size() - 1);
  for (ll i = 0, i_len = (input.size() - 1); i < i_len; ++i) {
    out[i].first = input[i];
    out[i].second = input[i + 1];
  }
  return (out);
}
vector<char> String_to_vector_char(const string& input) {
  vector<char> out(input.size());
  for (ll i = 0, i_len = (input.size()); i < i_len; ++i) {
    out[i] = input[i];
  }
  return out;
}
ll n, m;
vector<ll> a;
vector<ll> weight;
void input() {
  cin >> n >> m;
  a.resize(m, 0);
  weight.resize(n + 1, 0);
  for (ll i = 0, i_len = (m); i < i_len; ++i) {
    cin >> a[i];
    weight[a[i]] = -1;
  }
}
void src() {
  weight[0]++;
  for (ll i = 0, i_len = (n - 2); i < i_len; ++i) {
    if (weight[i] > 1000000007ll) {
      weight[i] = weight[i] % 1000000007ll;
    }
    if (weight[i] != -1) {
      weight[i + 1] += (weight[i + 1] != -1 ? weight[i] : 0);
      weight[i + 2] += (weight[i + 2] != -1 ? weight[i] : 0);
    }
  }
  if (weight[n - 2] != -1) {
    weight[n - 2] += (weight[n - 1] != -1 ? weight[n - 2] : 0);
  }
  ll ans = (weight[n - 1] != -1 ? weight[n - 1] : 0ll) +
           (weight[n - 2] != -1 ? weight[n - 2] : 0ll);
  cout << ans % 1000000007ll;
}
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  ifstream in(argv[1]);
  cin.rdbuf(in.rdbuf());
  input();
  src();
  return 0;
}
