#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
int N, M;
ll dp[111111];
int main() {
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  M = 0;
  dp[0] = 1;
  if (a[0] == 1)
    M++;
  else
    dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (a[M] == i)
      M++;
    else
      dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= mod;
  }
  cout << dp[N] << endl;
}
