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