#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  set<int> broken;
  for (int i = 0; i < (int)M; i++) {
    int a;
    cin >> a;
    broken.insert(a - 1);
  }
  vector<long long> memo;
  for (int i = 0; i < (int)N; i++) {
    if (broken.count(i)) {
      memo.push_back(0);
    } else if (i == 0) {
      memo.push_back(1);
    } else if (i == 1) {
      memo.push_back(1 + memo[i - 1]);
    } else {
      memo.push_back(memo[i - 1] + memo[i - 2]);
    }
  }
  cout << memo[N - 1] % 1000000007 << endl;
}
