#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int i;
  long long int c, ans = 1;
  cin >> n >> m;
  vector<long long int> a(m), b(n);
  for (i = 0; i < m; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    if (i <= 1)
      b[i] = i + (long long int)1;
    else
      b[i] = (b[i - 1] + b[i - 2]) % (long long int)(1e9 + 7);
  }
  for (i = 0; i <= m; i++) {
    if (i == 0)
      c = a[i] - 2;
    else if (i == m)
      c = n - a[i - 1] - 2;
    else
      c = a[i] - a[i - 1] - 3;
    if (c < 0)
      ans *= (c + 2);
    else
      ans = (ans * b[c]) % (long long int)(1e9 + 7);
  }
  cout << ans << endl;
  return 0;
}
