#include <bits/stdc++.h>
using namespace std;
long long a[111111];
long long b[111111];
signed main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
  }
  b[0] = 1;
  b[1] = 1;
  for (long long i = 2; i < 111111; i++) {
    b[i] = b[i - 1] + b[i - 2];
    b[i] = b[i] % 1000000007;
  }
  long long sum = b[a[0] - 1];
  for (long long i = 1; i < m; i++) {
    sum = sum * b[a[i] - a[i - 1] - 2];
    sum = sum % 1000000007;
    if (a[i] - a[i - 1] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  sum = sum * (n - 1 - a[m - 1]);
  sum = sum % 1000000007;
  cout << sum << endl;
}
