#include <bits/stdc++.h>
using namespace std;
int vector_finder(std::vector<int> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance(vec.begin(), itr);
  if (index != vec.size()) {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  queue<int> BFS;
  int cnt = 0;
  BFS.push(0);
  while (!BFS.empty()) {
    int t = BFS.front();
    BFS.pop();
    if (t == N) {
      cnt++;
    }
    for (int i = 1; i <= 2; i++) {
      int can = vector_finder(a, t + i);
      if (!can && t < N) BFS.push(t + i);
    }
  }
  int ans = cnt % 1000000007;
  cout << ans << endl;
}
