#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int N, M;
  int a = 0, oldA = -1;
  int i;
  long int ansA = 0, ansB = 1, temp = 0;
  int countM = 1;
  bool stFlag = false;
  cin >> N >> M;
  cin >> a;
  for (i = 1; i <= N; i++) {
    if (abs(a - oldA) == 1) {
      ansB = 0;
      break;
    }
    if (i == a) {
      stFlag = true;
      if (M == countM) continue;
      cin >> a;
      countM++;
      continue;
    }
    oldA = a;
    if (stFlag) {
      ansA = 0;
      stFlag = false;
    } else {
      temp = ansB;
      ansB = ansA + ansB;
      ansA = temp;
    }
  }
  cout << ansB % 1000000007 << endl;
  return 0;
}
