#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  unsigned long long int *ans = new unsigned long long int[N + 1];
  set<int> brokenStairs;
  for (int i = 0; i < M; i++) {
    int num;
    cin >> num;
    brokenStairs.insert(num);
  }
  ans[0] = 1;
  if (brokenStairs.count(1) == 0) {
    ans[1] = 1;
  } else {
    ans[1] = 0;
  }
  for (int i = 2; i <= N; i++) {
    if (brokenStairs.count(i) == 1) {
      ans[i] = 0;
    } else {
      ans[i] = ans[i - 1] + ans[i - 2];
    }
  }
  cout << ans[N] % 1000000007 << endl;
  return 0;
}
