#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "{";
  for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i];
  o << "}";
  return o;
}
template <class T>
ostream &operator<<(ostream &o, const pair<T, T> &p) {
  o << "(" << p.first << ", " << p.second << ")";
  return o;
}
int main(void) {
  lli n, m;
  cin >> n >> m;
  vector<lli> s(n + 10);
  vector<lli> a(m);
  for (auto &i : a) cin >> i;
  for (auto i : a) {
    s.at(i) = 1;
  }
  lli dp[100010];
  lli mod = 1e9 + 7;
  dp[0] = 1;
  for (int i = 0; i <= n; i++) {
    if (s.at(i + 1) != 1)
      dp[i + 1] += (dp[i]) % mod;
    else
      dp[i + 1] = 0;
    if (s.at(i + 2) != 1)
      dp[i + 2] += (dp[i]) % mod;
    else
      dp[i + 2] = 0;
  }
  cout << dp[n] % mod << endl;
  return 0;
}
