#include <bits/stdc++.h>
using namespace std;

int main() {
  int mod = 1e9 + 7;
  int N, M;
  cin >> N >> M;

  vector<int> aa(M);
  for (int k = 0; k < M; k++) { cin >> aa[k]; }
  
  vector<int> ans(N + 1);
  ans[0] = 1;

  for (int k = 1, l = 0; k <= N; k++) {
    if (l < m && aa[l] == k) { l++; continue; }
    if (k > 0) { ans[k] += ans[k - 1]; }
    if (k > 1) { ans[k] += ans[k - 2]; }
    ans[k] %= mod;
  }
  
  cout << ans[N] << endl;
}