#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll INF = 1000000007;
using Graph = vector<vector<int>>;
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;
}
bool seen[100000];
void dfs(const Graph& G, int v) {
  seen[v] = true;
  for (auto next_v : G[v]) {
    if (seen[next_v]) continue;
    dfs(G, next_v);
  }
}
ll dp[100050];
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  vector<bool> b(N, true);
  for (int i = 0; i < (M); i++) {
    cin >> a.at(i);
    b.at(a.at(i)) = false;
  }
  dp[0] = 1;
  if (a.at(0) != 1) dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (b.at(i)) {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
    dp[i] %= INF;
  }
  cout << dp[N] << endl;
  return 0;
}
