#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string &s, char delim) {
  vector<string> elems;
  string item;
  for (char ch : s) {
    if (ch == delim) {
      if (!item.empty()) elems.push_back(item);
      item.clear();
    } else {
      item += ch;
    }
  }
  if (!item.empty()) elems.push_back(item);
  return elems;
}
bool compare_by_b(tuple<int, string, int> a, tuple<int, string, int> b) {
  if (get<2>(a) != get<2>(b)) {
    return get<2>(a) > get<2>(b);
  }
}
bool compare_by_string(tuple<int, string, int> a, tuple<int, string, int> b) {
  if (get<1>(a) != get<1>(b)) {
    return get<1>(a) < get<1>(b);
  } else {
    return get<2>(a) > get<2>(b);
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  const long div = 1000000007;
  int N, M;
  cin >> N >> M;
  int idx = 0;
  vector<int> a(M);
  while (cin >> a[idx]) {
    if (idx != 0 && a[idx] == a[idx - 1] + 1) {
      cout << 0 << endl;
      return 0;
    }
    idx++;
  }
  int broken_step = 0;
  long step_2 = 0;
  long step_1 = 0;
  long step;
  for (int i = 1; i < N; i++) {
    if (i == a[broken_step]) {
      cerr << "broken step:" << i << endl;
      broken_step++;
      step_2 = step_1;
      step_1 = 0;
      continue;
    }
    if (i == 1)
      step_1 = 1;
    else if (i == 2) {
      step_2 = 1;
      if (step_1 != 0) step_1 += step_2;
    } else {
      step = (step_2 + step_1) % div;
      step_2 = step_1;
      step_1 = step;
    }
    if (i % 10 == 9) cerr << i << ":" << step_2 << " " << step_1 << endl;
  }
  cout << (step_2 + step_1) % div << endl;
  return 0;
}
