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