#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
template <class T>
using V = vector<T>;
const int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 62) - 1;
ll ceil(const ll& a, const ll& b) { return ((a) + (b)-1) / b; }
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 ll mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  V<bool> broken(n);
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    a--;
    broken[a] = true;
  }
  int dp[100005] = {};
  dp[0] = !broken[0];
  dp[1] = !broken[1] + dp[0];
  for (int i = 2; i < n; i++) {
    if (broken[i]) continue;
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << dp[n - 1] << '\n';
}
