#include <bits/stdc++.h>
using namespace std;
double fibnatch(int y) {
  if (y == 0) {
    return 0;
  } else if (y == 1) {
    return 1;
  } else {
    double sum;
    sum = fibnatch(y - 1) + fibnatch(y - 2);
    return sum;
  }
}
bool is_possibility(vector<int> x, int a) {
  if (x.at(a) - 1 == x.at(a - 1)) {
    return false;
  } else {
    return true;
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> holes(M + 1);
  holes.at(0) = 0;
  bool possibility = true;
  double root = 1;
  for (int i = 1; i < M + 1; i++) {
    cin >> holes.at(i);
  }
  int i = 1;
  while (possibility && i < M) {
    possibility = is_possibility(holes, i);
    if (holes.at(i) == 1) {
      possibility = true;
    }
    i++;
  }
  if (!possibility) {
    cout << 0 << endl;
  } else {
    for (int i = 1; i < M + 1; i++) {
      double Diff;
      if (i == M) {
        Diff = N - holes.at(i) - 1;
        root *= fibnatch(Diff + 1);
      }
      if (i == 1) {
        Diff = holes.at(i) - holes.at(i - 1) - 1;
      } else {
        Diff = holes.at(i) - holes.at(i - 1) - 2;
      }
      root *= fibnatch(Diff + 1);
    }
    cout << fmod(root, 1000000007) << endl;
  }
}
