#include <bits/stdc++.h>
using namespace std;
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;
const int N_MAX = 1e5;
const int BROKEN = 0;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  long long dp[N_MAX] = {};
  dp[0] = 1;
  for (int i = 0, j = 0; i < n; i++) {
    if (a[j] == i) j++, dp[i] = BROKEN;
    dp[i + 1] += dp[i], dp[i + 1] %= MOD;
    dp[i + 2] += dp[i], dp[i + 2] %= MOD;
  }
  cout << dp[n] << endl;
}
