#include <bits/stdc++.h>
using namespace std;
int kaidann(int dannsuu) {
  int current = 1;
  int next = 1;
  for (int i = 0; i < dannsuu; i++) {
    int tmp = current;
    current = next;
    next += tmp;
  }
  return current;
}
int main() {
  array<int, 100000> a;
  int n, m, ans = 1;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a.at(i);
  }
  a.at(m) = n + 1;
  if (m == 0) {
    ans = kaidann(n) % 1000000007;
  } else {
    ans = ans * kaidann(a.at(0) - 1);
    for (int i = 0; i < m; i++) {
      int s = a.at(i + 1) - a.at(i);
      if (s == 0) {
        ans = ans * 1;
      } else if (s == 1) {
        ans = 0;
      } else {
        ans = ans * kaidann(s - 2) % 1000000007;
      }
    }
  }
  cout << ans % 1000000007 << endl;
}
