#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long N, M;
  cin >> N >> M;
  vector<bool> broken(N + 1, true);
  for (int i = 0; i < M; ++i) {
    long long a;
    cin >> a;
    broken[a] = false;
  }
  long long pasos = 1;
  long long p = 0;
  for (long long i = 1; i < N + 1; ++i) {
    if (!broken[i] and !broken[i - 1]) {
      pasos = 0;
      break;
    }
    if (broken[i] and broken[i - 1] and (i > 1 and broken[i - 2])) {
      long long aux = pasos;
      pasos = (pasos + p) % 1000000007;
      p = aux;
    } else if (i == 1 and broken[i]) {
      long long aux = pasos;
      pasos = (pasos + p) % 1000000007;
      p = aux;
    } else {
      p = pasos;
    }
  }
  cout << pasos % 1000000007 << '\n';
  return 0;
}
