#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const int mx = 200010;
const long long mod = 1e9 + 7;
int n, m;
int a;
long long dp[mx];
bool dpflag[mx] = {true};
int main() {
  cin >> n >> m;
  for (int i = 0; i <= n; i++) {
    dpflag[i] = true;
  }
  for (int i = 0; i < m; i++) {
    cin >> a;
    dpflag[a] = false;
  }
  dp[0] = 1;
  if (dpflag[1]) {
    dp[1] = 1;
  }
  for (int now = 0; now < n; now++) {
    for (int next = now + 1; next <= n; next++) {
      if (dpflag[next]) {
        dp[next] = dp[now] + dp[now - 1];
        dp[next] %= mod;
      }
    }
  }
  cout << dp[n] << endl;
  return 0;
}
