#include <bits/stdc++.h>
using namespace std;
long long fib(int n) {
  long long i, p1 = 1, p2 = 1;
  long long val;
  for (i = 1; i <= n; i++) {
    if (i <= 2) {
      val = 1;
    } else {
      val = p1 + p2;
      p2 = p1;
      p1 = val;
    }
  }
  return val;
}
int main() {
  int n, m;
  cin >> n >> m;
  int brokenStep[m];
  for (int i = 0; i < m; i++) {
    cin >> brokenStep[i];
  }
  for (int i = 1; i < m; i++) {
    if (brokenStep[i - 1] == brokenStep[i] - 1) {
      int ans = 0;
      cout << ans << endl;
      return 0;
    }
  }
  long long ans = 1;
  if (brokenStep[0] > 2) {
    ans *= fib(brokenStep[0] - 2);
  }
  for (int i = 1; i < m; i++) {
    int subStep = fib(brokenStep[i] - brokenStep[i - 1] - 2);
    ans *= subStep;
  }
  ans *= fib(n - brokenStep[m - 1] - 1);
  cout << ans % 1000000007 << endl;
  return 0;
}
