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