#include <bits/stdc++.h>
using namespace std;
long long int fib(long long int n, vector<long long int> &table) {
  if (table[n] > 0) {
    return table[n];
  }
  for (long long int i = 2; i <= n; ++i) {
    table[i] = table[i - 1] + table[i - 2];
  }
  return table[n];
}
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> t(n + 1);
  t[0] = t[1] = 1;
  vector<long long int> a(m);
  for (long long int i = 0; i < m; i++) {
    cin >> a[i];
  }
  long long int res =
      fib(a[0] - 1, t) * fib(n - a[m - 1] - 1, t) % 1000000007LL;
  for (long long int i = 1; i < m; i++) {
    res *= fib(a[i] - a[i - 1] - 2, t) % 1000000007LL;
    res %= 1000000007LL;
  }
  cout << res % 1000000007LL << endl;
  return 0;
}
