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