#include <bits/stdc++.h>
using namespace std;
int zenka(int step) {
  if (step == 1)
    return 1;
  else if (step == 2)
    return 2;
  else if (step == 0)
    return 1;
  else
    return zenka(step - 1) + zenka(step - 2);
}
int main() {
  int n, m;
  int64_t sum = 1;
  cin >> n >> m;
  int var[m + 1];
  var[0] = 0;
  for (int i = 1; i <= (int)(m); i++) {
    cin >> var[i];
    if (i == 1) {
      if (var[i] == 1)
        sum = sum * 1;
      else
        sum *= zenka(var[i] - 1);
    } else if (var[i] - 1 == var[i - 1]) {
      cout << 0 << endl;
      return 0;
    } else
      sum *= zenka(var[i] - var[i - 1] - 2);
  }
  sum *= zenka(n - var[m] - 1);
  cout << sum % 1000000007 << endl;
}
