#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void YN(bool b) { cout << (b ? "Yes" : "No") << endl; }
template <class tuple>
inline tuple gcd(tuple a, tuple b) {
  if (b == 0) return a;
  return (gcd(b, a % b));
}
template <class tuple>
inline tuple lcm(tuple a, tuple b) {
  return a / gcd(a, b) * b;
}
template <class tuple>
inline bool chmax(tuple &a, const tuple &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class tuple>
inline bool chmin(tuple &a, const tuple &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (long long i = 0; i < (m); ++i) cin >> a[i];
  sort(a.begin(), a.end());
  bool cant = false;
  for (long long i = 0; i < (m - 1); ++i)
    if (a[i] + 1 == a[i + 1]) cant = true;
  if (cant) {
    cout << 0 << endl;
    return 0;
  }
  set<long long> st;
  for (long long i = 0; i < (m); ++i) st.insert(a[i]);
  long long res = 1;
  long long x = 1, y = 0;
  vector<long long> ans(n + 3, 0);
  for (long long i = 1; i <= (n); ++i) {
    if (st.find(i) == st.end()) {
      ans[i] = x + y;
      y = x;
      x = ans[i];
      ans[i] %= MOD;
      x %= MOD;
      y %= MOD;
    } else {
      ans[i + 1] = ans[i + 2] = x;
      i += 2;
      y = x;
      ans[i + 1] %= MOD;
      ans[i + 2] %= MOD;
      x %= MOD;
      y %= MOD;
    }
  }
  cout << (ans[n]) << endl;
  return 0;
}
