#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N + 1);
  for (int i = 0; i < (N + 1); i++) {
    int x;
    cin >> x;
    a.at(x) = 1;
  }
  vector<int> dp(N + 2);
  dp.at(N) = 1;
  for (int i = N - 1; i >= 0; i--) {
    if (a.at(i) == 1) {
      dp.at(i) = 0;
      continue;
    }
    dp.at(i) = (dp.at(i + 1) + dp.at(i + 2)) % 1000000007;
  }
  cout << dp.at(0) << endl;
}
