#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> a(n + 1, true);
  vector<long long int> ans(n + 1);
  int save;
  for (int i = 0; i < m; i++) {
    cin >> save;
    a.at(save) = false;
  }
  ans.at(0) = 1;
  if (a.at(1)) ans.at(1) = 1;
  for (int i = 2; i < n + 1; i++) {
    if (a.at(i)) ans.at(i) = ans.at(i - 1) + ans.at(i - 2);
  }
  cout << ans.at(n) % 1000000007 << endl;
}
