#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = LLONG_MAX;
int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> a(m);
  for (int i = 0; i < (m); i++) cin >> a[i];
  ll dp[n + 1];
  for (int i = 0; i < (n + 1); i++) dp[i] = 0;
  dp[0] = 1;
  for (int i = 0; i < (m); i++) dp[a[i]] = INF;
  for (int i = 0; i < (n); i++) {
    if (dp[i] < INF && dp[i] > 0) {
      if (dp[i + 1] < INF) {
        dp[i + 1] += dp[i];
      }
      if (dp[i + 2] < INF && i < n - 1) {
        dp[i + 2] += dp[i];
      }
    }
  }
  cout << dp[n] % 1000000007 << endl;
}
