#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  set<int> a;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    a.insert(x);
  }
  vector<long long> dp(n + 1);
  dp.at(0) = 1;
  if (a.count(1))
    dp.at(1) = 0;
  else
    dp.at(1) = 1;
  for (int i = 2; i <= n; i++) {
    if (a.count(i))
      dp.at(i) = 0;
    else
      dp.at(i) = dp.at(i - 1) + dp.at(i - 2);
  }
  cout << dp.at(n) % 1000000007 << endl;
}
