#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(max(2, M));
  for (int i = 0; i < M; i++){
    cin >> a.at(i);
  }
  vector<vector<int64_t>> way(max(1, N), vector<int64_t>(2));
  if (a.at(0) > 2 || a.at(0) == 0){
    way.at(0) = (1, 2);
  }
  else if(a.at(0) == 2){
    way.at(0) = (1, 0)
  }
  else if(a.at(0) == 1 && a.at(1) == 2){
    way.at(0) = (0, 0);
  }
  else{
    way.at(0) = (0, 1);
  }
  for (int i = 1 ; i < N; i++){
    way.at(i).at(0) = way.at(i).at(1);
    way.at(i).at(1) = way.at(i - 1).at(0) + way.at(i - 1).at(1);
    for (int j = 0; j < M; j++){
      if (a.at(j) == i + 2){
        way.at(i).at(1) = 0;
      }
      else if (a.at(j) > i + 2){
        break;
      }
    }
  }
  cout << way.at(N - 1) % 1000000007 << endl;
}
