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