#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using LP = pair<ll, ll>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> as(m);
  for (int i = 0; i < (m); ++i) cin >> as[i];
  vector<ll> dp(n + 1);
  dp[0] = 1;
  int j = 0;
  for (int i = 0; i < (n); ++i) {
    if (i + 1 == as[j]) {
      if (j < m - 1) j++;
    } else if (i + 1 <= n)
      dp[i + 1] = (dp[i + 1] + dp[i]) % 1000000007;
    if (i + 2 != as[j] && i + 2 <= n) {
      dp[i + 2] = (dp[i + 2] + dp[i]) % 1000000007;
    }
  }
  cout << dp[n] << endl;
}
