#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(2 * N);
  vector<long long> ans(2 * N);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  int tmp = 0;
  ans[0] = 1;
  if (a[tmp] == 1) {
    ans[1] = 0;
    tmp++;
  } else
    ans[1] = 1;
  for (int i = 0; i < N; i++) {
    if (a[tmp] == i + 2) {
      ans[i + 2] = 0;
      tmp++;
    } else
      ans[i + 2] = ans[i] + ans[i + 1];
  }
  cout << ans[N] % 1000000007 << endl;
}
