#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a;
  if (m != 0) a.resize(m);
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
  }
  uint64_t ans = 1;
  int st = 0;
  int ed = 0;
  if (m != 0) {
    if (a[0] == 0) {
      cout << 0 << endl;
      exit(0);
    }
  }
  if (m != 0) {
    if (a[m - 1] == n) {
      cout << 0 << endl;
      exit(0);
    }
  }
  if (m != 0) {
    for (int i = 0; i < m - 1; ++i) {
      if ((a[i] + 1) == a[i + 1]) {
        cout << 0 << endl;
        exit(0);
      }
    }
  }
  for (int i = 0; i <= m; ++i) {
    if (i == m) {
      ed = n + 1;
    } else {
      ed = a[i];
    }
    int a1 = 0;
    int a2 = 0;
    int n = 1;
    for (int j = st; j < ed; ++j) {
      if (j == st) {
        n = 1;
      } else {
        n = a1 + a2;
      }
      a1 = a2;
      a2 = n;
    }
    ans = (ans * n) % 1000000007;
    if (i != m) {
      st = a[i] + 1;
    }
  }
  cout << ans << endl;
  return 0;
}
