#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<int> breakstair(M);
  long int sol[N + 1];
  for (int i = 0; i < M; i++) {
    int k;
    cin >> k;
    breakstair.push_back(k);
  }
  int flag1 = 0, flag2 = 0;
  for (int i = 0; i < M; i++) {
    if (breakstair[i] == 1) {
      flag1 = 1;
      break;
    }
  }
  for (int i = 0; i < M; i++) {
    if (breakstair[i] == 2) {
      flag2 = 1;
      break;
    }
  }
  if (flag1 == 1) {
    sol[1] = 0;
    if (flag2 == 1) {
      sol[2] = 0;
    } else {
      sol[2] = 1;
    }
  } else if (flag2 == 1) {
    sol[1] = 1;
    sol[2] = 0;
  } else {
    sol[1] = 1;
    sol[2] = 2;
  }
  for (int i = 3; i <= N; i++) {
    int flag = 0;
    for (int j = 0; j < M; j++) {
      if (breakstair[j] == i) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      sol[i] = 0;
    } else {
      sol[i] = (sol[i - 1] + sol[i - 2]) % 1000000007;
    }
  }
  cout << sol[N] << endl;
}
