#include <bits/stdc++.h>
using namespace std;
using llong = long long;
void fnInput(int& rnStair, vector<int>& rvnBroken) {
  int nBrokenSiz;
  cin >> rnStair >> nBrokenSiz;
  rvnBroken.resize(nBrokenSiz + 2);
  rvnBroken[0] = -1;
  for (int i = 1; i < rvnBroken.size() - 1; i++) cin >> rvnBroken[i];
  rvnBroken[rvnBroken.size() - 1] = rnStair + 1;
}
int fnNumOfWays(int nStair, const vector<int>& cnrvnBroken) {
  vector<int> vnDPWays(nStair + 1);
  vnDPWays[0] = 1;
  for (int i = 1; i <= nStair; i++) {
    vnDPWays[i] += vnDPWays[i - 1];
    if (i > 1) vnDPWays[i] += vnDPWays[i - 2];
  }
  llong nNumOfWays = 1;
  for (int i = 1; i < cnrvnBroken.size(); i++) {
    if (i > 1 && cnrvnBroken[i - 1] + 1 == cnrvnBroken[i]) return 0;
    int nDiff = (cnrvnBroken[i] - 1) - (cnrvnBroken[i - 1] + 1);
    nNumOfWays *= vnDPWays[nDiff];
  }
  return nNumOfWays % 1000000007;
}
int main() {
  int nStair;
  vector<int> vnBroken;
  fnInput(nStair, vnBroken);
  cout << fnNumOfWays(nStair, vnBroken) << endl;
  return 0;
}
