#include <bits/stdc++.h>
using namespace std;
int counter(int x) {
  if (x == 0 || x == 1) {
    return 1;
  } else {
    return (counter(x - 1) + counter(x - 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;
  for (int i = 0; i <= m; i++) {
    if (i == 0) {
      mass *= counter(a.at(i) - 1);
    } else if (i == m) {
      mass *= counter(n - a.at(i - 1) - 1);
    } else {
      int tmp = a.at(i) - a.at(i - 1) - 2;
      if (tmp <= 0) {
        cout << "0" << endl;
        exit(0);
      } else if (tmp >= 2) {
        mass *= counter(tmp);
      }
    }
  }
  cout << mass % 1000000007 << endl;
}
