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