#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using lP = pair<ll, ll>;
using fP = pair<double, double>;
ll const mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<ll> dp(n + 1);
  for (long long i = 0; i < m; ++i) cin >> a[i];
  dp[0] = 1;
  int j = 0;
  if (a[0] == 1) {
    dp[1] = 0;
    j++;
  } else
    dp[1] = 1;
  for (int i = int(2); i < (int)(n + 1); i++) {
    if (a[j] == i) {
      dp[i] = 0;
      j++;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= mod;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
