#include <bits/stdc++.h>
using namespace std;
const static int INT_INF = 2147483647;
const static int MOD_NUM = 1000000007;
static int ans_vec[100010] = {0};
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> vec;
  for (size_t i = 0; i < m; i++) {
    int tmp;
    cin >> tmp;
    vec.emplace_back(tmp);
  }
  bool reachable = true;
  for (size_t i = 0; i < m - 1; i++) {
    if (vec[i + 1] - vec[i] == 1) reachable = false;
  }
  if (reachable) {
    int index = 0;
    ans_vec[0] = 1;
    if (vec[0] == 1) {
      index++;
      ans_vec[1] = 0;
    } else {
      ans_vec[1] = 1;
    }
    for (size_t i = 2; i <= n; i++) {
      if (vec[index] == i) {
        index = index + 1;
        if (index > vec.size() - 1) index = vec.size() - 1;
        ans_vec[i] = 0;
      } else {
        ans_vec[i] = ans_vec[i - 1] + ans_vec[i - 2];
        if (ans_vec[i] > MOD_NUM) ans_vec[i] %= MOD_NUM;
      }
    }
    cout << ans_vec[n] << endl;
  } else {
    cout << 0 << endl;
  }
}
