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