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