#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  int a[M];
  for (int i = 0; i < (int)(M); i++) {
    cin >> a[i];
  }
  long long int p = 1;
  long long int fib[N + 2];
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 0; i < (int)(N); i++) {
    fib[i + 2] = (fib[i + 1] + fib[i]) % (long long int)(1e9 + 7);
  }
  int d;
  if (M > 1) {
    for (int i = 0; i < (int)(M - 1); i++) {
      d = a[i + 1] - a[i];
      if (d == 1) {
        p = 0;
      }
    }
  } else if (M == 1) {
    p = fib[a[0] - 1] * fib[N - a[M - 1] - 1] % (long long int)(1e9 + 7);
  } else {
    p = fib[N];
  }
  if (p == 1) {
    if (N == 1) {
      p = 1;
    } else {
      p = fib[a[0] - 1] % (long long int)(1e9 + 7);
      cout << p % (long long int)(1e9 + 7) << endl;
      if (M > 1) {
        for (int i = 1; i <= (int)(M - 1); i++) {
          p = (p * fib[a[i] - a[i - 1] - 2]) % (long long int)(1e9 + 7);
          cout << p % (long long int)(1e9 + 7) << endl;
        }
      }
      p = (p * fib[N - a[M - 1] - 1]) % (long long int)(1e9 + 7);
      cout << p % (long long int)(1e9 + 7) << endl;
    }
  }
  cout << p % (long long int)(1e9 + 7) << endl;
  return 0;
}
