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