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