#include <bits/stdc++.h>
using namespace std;
long long int calcStepCombinationCount(int step, int nowCount = 0,
                                       long long int sub1 = 1,
                                       long long int sub2 = 0) {
  if (nowCount == 1) {
    sub1 = 1;
  } else if (nowCount == 2) {
    sub1 = 1;
    sub2 = 1;
  } else if (nowCount > 2) {
    int tmp = sub2;
    sub2 = sub1;
    sub1 = tmp + sub1;
  }
  if (step == nowCount) return sub1 + sub2;
  nowCount++;
  return calcStepCombinationCount(step, nowCount, sub1, sub2);
}
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int allStep = 1;
  int broken = 0;
  int current = 0;
  for (int i = 0; i < m; i++) {
    cin >> broken;
    if (broken == current) {
      cout << 0;
      return 0;
    }
    allStep *= calcStepCombinationCount(broken - 1 - current, 0);
    allStep %= 1000000007LL;
    current = broken + 1;
  }
  allStep *= calcStepCombinationCount(n - current);
  allStep %= 1000000007LL;
  cout << allStep;
  return 0;
}
