#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  vector<ll> dp(N + 1);
  for (int i = 0; i < (int)(M); i++) {
    cin >> a.at(i);
  }
  dp.at(0) = 1;
  if (a.at(0) == 1)
    dp.at(1) = 0;
  else
    dp.at(1) = 1;
  for (int i = 2; i <= N; i++) {
    dp.at(i) = dp.at(i - 1) + dp.at(i - 2);
    dp.at(i) %= 1000000007;
    for (int j = 0; j < (int)(M); j++)
      if (i == a.at(j)) dp.at(i) = 0;
  }
  cout << dp.at(N) % 1000000007 << endl;
  return 0;
}
