#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long N, M;
vector<bool> Ok;
vector<long long> Dp;
int main() {
  cin >> N >> M;
  Ok.resize(N + 1, true);
  for (long long i = 0; i < M; ++i) {
    long long a;
    cin >> a;
    Ok[a] = false;
  }
  Dp.resize(N + 1);
  for (long long i = 1; i <= N; ++i) {
    if (Ok[i - 1]) (Dp[i] += Dp[i - 1]) %= MOD;
    if (i >= 2 && Ok[i - 2]) (Dp[i] += Dp[i - 2]) %= MOD;
  }
  cout << Dp[N] << endl;
  return 0;
}
