#include <bits/stdc++.h>
using namespace std;
unsigned long long int fib(int n) {
  unsigned long long int f[n + 2];
  unsigned long long int i;
  f[0] = 0;
  f[1] = 1;
  for (i = 2; i <= n; i++) {
    f[i] = f[i - 1] + f[i - 2];
  }
  return f[n];
}
int n, w[1000000], c = 0, aux = 1, q, f;
unsigned long long int r = 1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> q;
  for (int i = 1; i <= q; i++) {
    cin >> w[i];
    if (i != 1 && w[i] == w[i - 1] + 1) r = 0;
  }
  if (r != 0) {
    for (int i = 0; i <= n; i++) {
      c++;
      if (i == w[aux]) {
        aux++;
        f++;
        if (c > 1) c--;
        if (f == 1)
          r = fib(c);
        else
          r *= fib(c);
        c = 0;
      }
      r = r % 1000000007;
    }
    r *= fib(c);
  }
  cout << r % 1000000007 << endl;
}
