#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
auto seen = vector<bool>(500);
void dfs(Graph &G, int v) {
  seen[v] = true;
  for (auto nv : G[v]) {
    if (seen[nv] == true) continue;
    dfs(G, nv);
  }
}
void chmin(int &n, int m) {
  if (n > m) n = m;
}
int main() {
  int n, m;
  long mod = 1000000007;
  cin >> n >> m;
  long dp[n];
  auto a = vector<int>(m);
  for (int i = 0; (i) < (int)(m); i++) {
    cin >> a[i];
    dp[a[i]] = 0;
  }
  dp[0] = 1;
  dp[1] = 1;
  int j = 0;
  for (int i = (int)(2); (i) <= (int)(n); i++) {
    if (i == a[j]) {
      if (j < m) j++;
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  long res = dp[n] % mod;
  cout << res << endl;
}
