#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> b(M + 1);
  b.at(M) = 0;
  for (int i = 0; i < M; i++) {
    cin >> b.at(i);
  }
  vector<long long int> a(N + 1);
  int j = 0;
  bool g = false;
  for (int i = 1; i <= N; i++) {
    if (i == 1) {
      if (b.at(j) == 1) {
        a.at(i) = 0;
        j++;
        g = true;
        if (b.at(j) == 2) {
          a.at(N) = 0;
          break;
        }
      } else
        a.at(i) = 1;
    } else if (i == 2) {
      if (b.at(j) == 2) {
        a.at(i) = 0;
        j++;
      } else
        a.at(i) = 2;
      if (g) a.at(i) = 1;
    } else {
      if (i == b.at(j)) {
        a.at(i) = 0;
        j++;
      } else
        a.at(i) = a.at(i - 1) + a.at(i - 2);
    }
  }
  cout << a.at(N) % 1000000007 << endl;
}
