#include <bits/stdc++.h>
using namespace std;
long long int fib(int n) {
  if (n == 0) return 1;
  if (n == 1) return 1;
  if (n == 2) return 2;
  return fib(n - 1) + fib(n - 2);
}
int main(int argc, char *argv[]) {
  int i;
  int n, m;
  cin >> n >> m;
  vector<int> hole(m);
  long long int answer = 0;
  for (i = 0; i < m; i++) cin >> hole[i];
  for (i = 0; i < m - 1; i++) {
    if (hole[i + 1] - hole[i] == 1) {
      cout << '0' << endl;
      return 0;
    }
  }
  answer = fib(hole[0] - 1);
  for (i = 0; i < m - 1; i++) answer *= fib(hole[i + 1] - hole[i] - 2);
  answer *= fib(n - hole[m - 1] - 1);
  cout << answer % 1000000007 << endl;
  return 0;
}
