#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const int mod = 1e9 + 7;
int a[100000];
int m;
bool point(int k) {
  bool s = true;
  if (find(a, a + m, k) - a == m) s = false;
  return s;
}
int main(void) {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n >> m;
  for (int i = 0; i < (int)m; ++i) {
    cin >> a[i];
    a[i]--;
  }
  ll dp[n + 1];
  if (point(0)) {
    dp[0] = 0;
  } else
    dp[0] = 1;
  if (point(1)) {
    dp[1] = 0;
  } else
    dp[1] = dp[0] + 1;
  for (int i = 2; i < n; ++i) {
    if (point(i))
      dp[i] = 0;
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << dp[n - 1] << endl;
  return 0;
}
