#include <bits/stdc++.h>
using namespace std;
long long DENOM = 1000000007L;
long long fib(int n) {
  if (n < 1) return 1;
  vector<long long> res(n + 1, 1);
  for (int i = 3; i < n + 1; ++i) {
    res[i] = res[i - 1] + res[i - 2];
    res[i] = res[i] % DENOM;
  }
  return res[n];
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int& aa : a) {
    cin >> aa;
  }
  int pt = 0;
  long long score = 1;
  score *= fib(a[0] - pt);
  pt = a[0];
  score %= DENOM;
  for (int i = 1; i < m; ++i) {
    int stp = a[i] - pt;
    if (stp == 1) {
      score = 0;
      break;
    }
    score *= (fib(stp - 1));
    score %= DENOM;
    pt = a[i];
  }
  score *= (fib(n - pt));
  cout << score % DENOM << endl;
  return 0;
}
