#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  vector<long long> dp(N + 1);
  for (int i = 1; i <= N; i++) {
    if (binary_search(a.begin(), a.end(), i)) {
      dp.at(i) = 0;
      continue;
    }
    switch (i) {
      case 1:
        dp.at(i) = 1;
        break;
      case 2:
        dp.at(i) = 2;
        break;
      default:
        dp.at(i) = dp.at(i - 1) + dp.at(i - 2);
        break;
    }
  }
  cout << dp.at(N) % mod << endl;
}
