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