#include <bits/stdc++.h>
using namespace std;
vector<long long> memo(10e5, -1);
int counter(int n) {
  if (memo[n] != -1) return memo[n];
  return memo[n] = counter(n - 1) + counter(n - 2);
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a.at(i);
  }
  vector<int> sep(m + 1);
  long long mass = 1;
  int tmp;
  memo[0] = 0;
  memo[1] = 1;
  for (int i = 0; i <= m; i++) {
    if (i == 0) {
      tmp = a.at(i);
      if (tmp >= 3) mass *= counter(tmp);
    } else if (i == m) {
      tmp = n - a.at(i - 1);
      if (tmp >= 3) mass *= counter(tmp);
    } else {
      int tmp = a.at(i) - a.at(i - 1) - 1;
      if (tmp == 0) {
        cout << "0" << endl;
        exit(0);
      } else if (tmp >= 3)
        mass *= counter(tmp);
    }
  }
  cout << mass % 1000000007 << endl;
}
