#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, i, j, sub, sn, fn, fib, root, dp[1000];
  cin >> N >> M;
  int a[M];
  for (i = 0; i < M; i++) cin >> a[i];
  if (M > 1) {
    for (i = 1; i < M; i++) {
      sub = a[i] - a[i - 1];
      if (sub == 1) {
        cout << "0";
        exit(0);
      }
    }
  }
  root = 1;
  if (a[0] == 1) {
    sn = 2;
    for (i = 1; i < M; i++) {
      fn = a[i] - 1;
      fib = fn - sn;
      dp[1000] = {0};
      dp[0] = 1;
      dp[1] = 2;
      for (j = 2; j < fib; j++) {
        dp[j] = dp[j - 1] + dp[j - 2];
      }
      root *= dp[fib - 2];
      sn = a[i] + 1;
    }
  } else {
    sn = 0;
    for (i = 0; i < M; i++) {
      fn = a[i] - 1;
      fib = fn - sn;
      dp[1000] = {0};
      dp[0] = 1;
      dp[1] = 2;
      for (j = 2; j < fib; j++) {
        dp[j] = dp[j - 1] + dp[j - 2];
      }
      root *= dp[fib - 2];
      sn = a[i] + 1;
    }
  }
  fib = N - sn;
  dp[1000] = {0};
  dp[0] = 1;
  dp[1] = 2;
  for (j = 2; j < fib; j++) {
    dp[j] = dp[j - 1] + dp[j - 2];
  }
  root *= dp[fib - 2];
  root %= 1000000007;
  cout << root;
  return 0;
}
