#include <bits/stdc++.h>
using namespace std;
vector<int> vec;
vector<int> dp;
inline int recursive(int n) {
  int index = lower_bound(vec.begin(), vec.end(), n) - vec.begin();
  int end_index = lower_bound(vec.begin(), vec.end(), n) - vec.end();
  if (n == -1) {
    return 0;
  }
  if (n == 0) {
    if (vec.at(0) != 0) {
      return 1;
    } else {
      return 0;
    }
  }
  if (n == 1) {
    if (vec.at(0) != 1 && vec.at(1) != 1) {
      return 1;
    } else {
      return 0;
    }
  }
  if (dp.at(n - 1) > -1) {
    return dp.at(n - 1);
  } else {
    if (end_index == 0) {
      dp.at(n - 1) =
          recursive(n - 1) % 1000000007 + recursive(n - 2) % 1000000007;
      return recursive(n - 1) % 1000000007 + recursive(n - 2) % 1000000007;
    } else {
      if (n - vec.at(index) != 0) {
        if (n > 1) {
          dp.at(n - 1) =
              recursive(n - 1) % 1000000007 + recursive(n - 2) % 1000000007;
          return recursive(n - 1) % 1000000007 + recursive(n - 2) % 1000000007;
        } else if (n == 1 || n == 0) {
          return 1;
        }
      } else {
        return 0;
      }
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int j = 0; j < m; j++) {
    int a;
    cin >> a;
    vec.push_back(a);
  }
  for (int i = 0; i < n; i++) {
    dp.push_back(-1);
  }
  cout << recursive(n) % 1000000007 << endl;
}
