#include <bits/stdc++.h>
using namespace std;
void energy_drink_collector() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> ab(n);
  for (int i = 0; i < n; ++i) cin >> ab[i].first >> ab[i].second;
  sort(ab.begin(), ab.end());
  long long int total_fee = 0;
  for (int i = 0; i < n && m > 0; ++i) {
    total_fee +=
        (long long int)ab[i].first * (long long int)min(m, ab[i].second);
    m -= min(m, ab[i].second);
  }
  cout << total_fee << "\n";
}
void get_AC() {
  int n, q;
  string S;
  cin >> n >> q >> S;
  vector<int> cnt(n + 1);
  for (int i = 0; i < n; ++i) {
    if (i + 1 < n && S[i] == 'A' && S[i + 1] == 'C')
      cnt[i + 1] = cnt[i] + 1;
    else
      cnt[i + 1] = cnt[i];
  }
  for (int i = 0; i < q; ++i) {
    int l, r;
    cin >> l >> r;
    cout << cnt[r - 1] - cnt[l - 1] << "\n";
  }
}
void five_transportations() {
  long long int n;
  cin >> n;
  long long int v_min = 1000000000000000, tmp;
  for (int i = 0; i < 5; ++i) {
    cin >> tmp;
    v_min = min(v_min, tmp);
  }
  cout << (n - 1) / v_min + 5;
}
void coloring_colorfully() {
  string s;
  cin >> s;
  int cnt_01 = 0, cnt_10 = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (i % 2 == 0) {
      if (s[i] != '0')
        ++cnt_01;
      else
        ++cnt_10;
    } else {
      if (s[i] != '1')
        ++cnt_01;
      else
        ++cnt_10;
    }
  }
  cout << min(cnt_01, cnt_10) << "\n";
}
void gcd_on_blackboard() {}
void dice_and_coin() {
  int n, k;
  cin >> n >> k;
  double res = 0;
  for (int i = 1; i <= n; ++i) {
    double tmp = 1.0 / n;
    int point_now = i;
    while (point_now < k) {
      point_now *= 2;
      tmp /= 2;
    }
    res += tmp;
  }
  cout << setprecision(10) << res << "\n";
}
void prison() {}
void switches() {}
void typical_stairs() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; ++i) cin >> a[i];
  vector<bool> broken(n);
  for (int i = 0; i < m; ++i) broken[a[i]] = true;
  vector<int> f(n + 1);
  f[0] = 1;
  if (!broken[1]) f[1] = 1;
  for (int i = 0; i < n + 1; ++i) {
    if (i == 0 || i == 1) continue;
    if (!broken[i]) f[i] = f[i - 1] + f[i - 2];
  }
  cout << f[n] % 1000000007 << "\n";
}
int main() { typical_stairs(); }
