#include <bits/stdc++.h>
using namespace std;
long pattern[100000] = {-1};
int MOD = 1000000007;
long getPattern(long n) {
  if (n < 2) {
    pattern[n] = 1;
    return 1;
  } else {
    if (pattern[n] > 0) {
      return pattern[n];
    } else {
      pattern[n - 1] = getPattern(n - 1);
      pattern[n - 2] = getPattern(n - 2);
      pattern[n] = pattern[n - 1] + pattern[n - 2];
      return pattern[n];
    }
  }
}
int main() {
  int n, m, a[100000];
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  if (m == 0) {
    cout << getPattern(n) << endl;
    return 0;
  }
  long pat = getPattern(a[0] - 1);
  for (int k = 1; k < m; k++) {
    if (a[k] == a[k - 1] + 1) {
      cout << 0 << endl;
      return 0;
    }
    pat = pat * getPattern((a[k] - 1) - (a[k - 1] + 1)) % MOD;
  }
  pat = pat * getPattern(n - (a[m - 1] + 1)) % MOD;
  cout << pat << endl;
  return 0;
}
