#include <bits/stdc++.h>
const long long mod = 1000000007;
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  long long w[m + 1];
  w[0] = a[0];
  w[m] = n - a[m - 1];
  long long wm = max(w[0], w[m]);
  for (int i = 0; i < m - 1; i++) {
    w[i + 1] = a[i + 1] - a[i] - 1;
    wm = max(wm, w[i + 1]);
  }
  long long fib[wm];
  fib[0] = 0;
  fib[1] = 1;
  for (int i = 2; i < wm + 1; i++) {
    fib[i] = (fib[i - 1] % mod + fib[i - 2] % mod) % mod;
  }
  long long count = 1;
  for (int i = 0; i < m + 1; i++) {
    count *= fib[w[i]] % mod;
  }
  cout << count % mod << "\n";
}
