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